Permalink
Browse files

Namespace fixes for PHPWS_Cookie

  • Loading branch information...
Stardog committed Nov 13, 2017
1 parent a8a3b64 commit 1d653bb5a45691f48124a2361222f238e76d70ca
@@ -162,27 +162,27 @@ public function process()
break;
case 'hide_panel':
PHPWS_Cookie::write('checkin_hide_panel', 1);
\phpws\PHPWS_Cookie::write('checkin_hide_panel', 1);
\phpws\PHPWS_Core::goBack();
break;
case 'show_panel':
PHPWS_Cookie::delete('checkin_hide_panel');
\phpws\PHPWS_Cookie::delete('checkin_hide_panel');
\phpws\PHPWS_Core::goBack();
$this->panel->setCurrentTab('assign');
$this->assign();
break;
case 'hide_sidebar':
PHPWS_Cookie::write('checkin_hide_sidebar', 1);
\phpws\PHPWS_Cookie::write('checkin_hide_sidebar', 1);
\phpws\PHPWS_Core::goBack();
$this->panel->setCurrentTab('assign');
$this->use_sidebar = false;
$this->assign();
break;
case 'show_sidebar':
PHPWS_Cookie::delete('checkin_hide_sidebar');
\phpws\PHPWS_Cookie::delete('checkin_hide_sidebar');
\phpws\PHPWS_Core::goBack();
$this->panel->setCurrentTab('assign');
$this->assign();
@@ -22,10 +22,10 @@ function javascript($directory, $data = NULL, $base = null, $wrap_header = false
function check_cookie()
{
$cookie = PHPWS_Cookie::read('cookie_enabled');
$cookie = \phpws\PHPWS_Cookie::read('cookie_enabled');
if (!$cookie) {
if (!isset($_GET['cc'])) {
PHPWS_Cookie::write('cookie_enabled', 'y');
\phpws\PHPWS_Cookie::write('cookie_enabled', 'y');
\phpws\PHPWS_Core::reroute('index.php?cc=1');
} else {
$tpl['MESSAGE'] = 'This site requires you to enable cookies on your browser.';
@@ -193,7 +193,7 @@ public function loadStyleSheets($themeVars)
$this->_extra_styles = null;
$this->_style_sheets = null;
$directory = sprintf('themes/%s/', $this->current_theme);
@$cookie = PHPWS_Cookie::read('layout_style');
@$cookie = \phpws\PHPWS_Cookie::read('layout_style');
for ($i = 1; $i < 20; $i++) {
if (isset($themeVars['style_sheet_' . $i])) {
@@ -59,7 +59,7 @@ public static function user_form()
$css = Layout::getAlternateStyles();
if ($css) {
$form->addSelect('alternate', $css);
$form->setMatch('alternate', PHPWS_Cookie::read('layout_style'));
$form->setMatch('alternate', \phpws\PHPWS_Cookie::read('layout_style'));
$form->setLabel('alternate', 'Available styles');
$form->addSubmit('Save settings');
} else {
@@ -74,7 +74,7 @@ public static function user_form()
public function save_settings()
{
if (isset($_POST['alternate'])) {
PHPWS_Cookie::write('layout_style', $_POST['alternate']);
\phpws\PHPWS_Cookie::write('layout_style', $_POST['alternate']);
return TRUE;
}
}
@@ -495,7 +495,7 @@ public static function rememberLogin()
return false;
}
$remember = PHPWS_Cookie::read('remember_me');
$remember = \phpws\PHPWS_Cookie::read('remember_me');
if (!$remember) {
return false;
}
View
@@ -130,7 +130,7 @@ public static function userForm(PHPWS_User $user, $message = NULL)
if (isset($_REQUEST['timezone'])) {
$user_tz = $_REQUEST['timezone'];
} else {
$user_tz = PHPWS_Cookie::read('user_tz');
$user_tz = \phpws\PHPWS_Cookie::read('user_tz');
}
$form->addSelect('timezone', $timezones);
@@ -141,7 +141,7 @@ public static function userForm(PHPWS_User $user, $message = NULL)
if (isset($_REQUEST['dst']) && $_REQUEST['timezone'] != 'server') {
$dst = $_REQUEST['dst'];
} else {
$dst = PHPWS_Cookie::read('user_dst');
$dst = \phpws\PHPWS_Cookie::read('user_dst');
}
$form->addCheckbox('dst', 1);
@@ -151,7 +151,7 @@ public static function userForm(PHPWS_User $user, $message = NULL)
if (isset($_POST['cp'])) {
$cp = (int) $_POST['cp'];
} else {
$cp = (int) PHPWS_Cookie::read('user_cp');
$cp = (int) \phpws\PHPWS_Cookie::read('user_cp');
}
if (Current_User::allowRememberMe()) {
@@ -210,27 +210,27 @@ public static function setTZ()
}
if ($_POST['timezone'] == 'server') {
PHPWS_Cookie::delete('user_tz');
PHPWS_Cookie::delete('user_dst');
\phpws\PHPWS_Cookie::delete('user_tz');
\phpws\PHPWS_Cookie::delete('user_dst');
return;
} else {
PHPWS_Cookie::write('user_tz', strip_tags($_POST['timezone']));
\phpws\PHPWS_Cookie::write('user_tz', strip_tags($_POST['timezone']));
}
if (isset($_POST['dst'])) {
PHPWS_Cookie::write('user_dst', 1);
\phpws\PHPWS_Cookie::write('user_dst', 1);
} else {
PHPWS_Cookie::delete('user_dst');
\phpws\PHPWS_Cookie::delete('user_dst');
}
}
public static function setCP()
{
if (isset($_POST['cp'])) {
PHPWS_Cookie::write('user_cp', 1);
\phpws\PHPWS_Cookie::write('user_cp', 1);
} else {
PHPWS_Cookie::delete('user_cp');
\phpws\PHPWS_Cookie::delete('user_cp');
}
}
@@ -253,10 +253,10 @@ public static function rememberMe()
$remember['username'] = $_SESSION['User']->username;
$remember['password'] = $password;
$time_to_live = time() + (86400 * REMEMBER_ME_LIFE);
PHPWS_Cookie::write('remember_me', serialize($remember),
\phpws\PHPWS_Cookie::write('remember_me', serialize($remember),
$time_to_live);
} else {
PHPWS_Cookie::delete('remember_me');
\phpws\PHPWS_Cookie::delete('remember_me');
}
}
}
@@ -102,7 +102,7 @@ public function getName()
public static function getUserType()
{
if ($user_type = PHPWS_Cookie::read('phpws_editor')) {
if ($user_type = \phpws\PHPWS_Cookie::read('phpws_editor')) {
if ($user_type == 'none') {
return null;
}
@@ -114,7 +114,7 @@ public static function getUserType()
if (Editor::isType($user_type)) {
return $user_type;
} else {
PHPWS_Cookie::delete('phpws_editor');
\phpws\PHPWS_Cookie::delete('phpws_editor');
}
}
@@ -143,12 +143,12 @@ public static function getServerTZ()
*/
public static function getUserTZ()
{
$user_tz = PHPWS_Cookie::read('user_tz');
$user_tz = \phpws\PHPWS_Cookie::read('user_tz');
if (!isset($user_tz)) {
return PHPWS_Time::getServerTZ();
} else {
$user_dst = PHPWS_Cookie::read('user_dst');
$user_dst = \phpws\PHPWS_Cookie::read('user_dst');
if (!isset($user_dst)) {
return $user_tz;
} else {

0 comments on commit 1d653bb

Please sign in to comment.