#along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # #$Id: editprefs.php 7685 2012-01-22 21:52:55Z calguy1000 $ /** * Init variables / objects */ $CMS_ADMIN_PAGE = 1; $CMS_TOP_MENU = 'admin'; $CMS_ADMIN_TITLE = 'myaccount'; require_once "../include.php"; $urlext = '?' . CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY]; $thisurl = basename(__FILE__) . $urlext; $userid = get_userid(); // Checks also login $userobj = UserOperations::get_instance()->LoadUserByID($userid); // <- Safe to do, cause if $userid fails, it redirects automatically to login. $db = cmsms()->GetDb(); $error = ''; $message = ''; /** * Get preferences */ $ignoredmodules = explode(',', get_preference($userid, 'ignoredmodules')); $gcb_wysiwyg = get_preference($userid, 'gcb_wysiwyg', 1); $wysiwyg = get_preference($userid, 'wysiwyg'); $syntaxhighlighter = get_preference($userid, 'syntaxhighlighter'); $default_cms_language = get_preference($userid, 'default_cms_language'); $old_default_cms_lang = $default_cms_language; $admintheme = get_preference($userid, 'admintheme', CmsAdminThemeBase::GetDefaultTheme()); $bookmarks = get_preference($userid, 'bookmarks', 0);
/** * Get a handle to the CMS UserOperations object. If it does not yet * exist, this method will instantiate it. * * @final * @see UserOperations * @return UserOperations handle to the UserOperations object */ public function &GetUserOperations() { return UserOperations::get_instance(); }
function GenerateDropdown($currentuserid = '', $name = 'ownerid') { $result = ''; $allusers = UserOperations::LoadUsers(); if (count($allusers) > 0) { $result .= '<select name="' . $name . '">'; foreach ($allusers as $oneuser) { $result .= '<option value="' . $oneuser->id . '"'; if ($oneuser->id == $currentuserid) { $result .= ' selected="selected"'; } $result .= '>' . $oneuser->username . '</option>'; } $result .= '</select>'; } return $result; }
/** * Get the username of the currently logged in admin user. * * @deprecated * @param int $uid * @return string */ function GetAdminUsername($uid) { $user = UserOperations::LoadUserByID($uid); return $user->username; }