} $settings = NowhereCore::FetchSettings(); include GlobalCore::template('settings'); } else { GlobalCore::nwHeader('Location: ' . NWDIR); } break; case 'output': if ($nw_uid) { include GlobalCore::template('output'); } else { GlobalCore::nwHeader('Location: ' . NWDIR); } break; case 'js': $status = NowhereCore::FetchUserStatus(1, 16, 16, 1); $url = GlobalCore::SubURL($_SERVER['REQUEST_URI']); $limit = isset($url['limit']) ? intval(trim($url['limit'])) : 1; GlobalCore::nwHeader('Content-type: text/javascript; charset=utf-8'); include GlobalCore::template('js'); break; case 'feed': $status = NowhereCore::FetchUserStatus(1, 16, 16, 1); GlobalCore::nwHeader("Content-type: application/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; include GlobalCore::template('feed'); break; case 'login': include GlobalCore::template('login'); break; }
public static function AjaxReferer($location, $referer = 1, $addon = '') { $url = GlobalCore::SubURL($_SERVER['REQUEST_URI']); if ($url['ajax'] == 1) { GlobalCore::returnAjaxStatus($addon); } elseif (GlobalCore::nwReferer() && $referer == 1) { GlobalCore::nwHeader('Location: ' . GlobalCore::nwReferer()); } else { GlobalCore::nwHeader('Location: ' . $location); } }
public static function UpdateSettings() { global $db, $nw_uid, $nw_pw, $tablepre, $timestamp, $adminid, $basic_settings, $webservice_settings, $password_old, $password_new, $password_new2; $define_settings = self::FetchDefineSettings(); foreach ($define_settings as $key) { $val = GlobalCore::chobits_addslashes(trim($_POST[$key])); $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('{$key}', '{$val}')"); } if ($_POST['nickname']) { $nickname = GlobalCore::chobits_addslashes(GlobalCore::cutstr(GlobalCore::nwHtmlspecialchars($_POST['nickname']), 25, '')); $avatar = GlobalCore::chobits_addslashes(GlobalCore::nwHtmlspecialchars($_POST['avatar'])); $db->query("UPDATE {$tablepre}members SET nickname='{$nickname}',avatar='{$avatar}' WHERE uid = '{$nw_uid}'"); $db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('avatar', '{$avatar}')"); } if ($_POST['password_new']) { if (md5($password_old) != $nw_pw) { GlobalCore::showmessage('profile_passwd_wrong', NULL, 'HALTED'); } if ($password_new) { if ($password_new != addslashes($password_new)) { GlobalCore::showmessage('profile_passwd_illegal'); } elseif ($password_new != $password_new2) { GlobalCore::showmessage('profile_passwd_notmatch'); } $newpasswd = md5($password_new); $db->query("UPDATE {$tablepre}members SET password ='******' WHERE uid = '{$nw_uid}'"); GlobalCore::showmessage('password_set_succeed', NWDIR . '/login', 'DONE'); } } self::UpdateSettingsCache(); GlobalCore::nwHeader('Location: ' . NWDIR . '/settings'); }