From: Eloi G. <ada...@us...> - 2004-09-17 15:53:42
|
Update of /cvsroot/phpwsbb/phpwsbb/class In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24523/class Modified Files: Manager.php Log Message: Allowed admins to edit other user's settings through an option on the message display. Index: Manager.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/class/Manager.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Manager.php 15 Sep 2004 20:53:34 -0000 1.46 --- Manager.php 17 Sep 2004 15:53:33 -0000 1.47 *************** *** 586,592 **** * * @author Don Seiler <do...@NO...> */ ! function _getUserSettings() { ! if(!$_SESSION['OBJ_user']->username) { $message = $_SESSION['translate']->it('Access to edit settings was denied.'); $error = new PHPWS_Error('phpwsbb', 'PHPWSBB_Manager::_getSettings()', $message, 'exit', 1); --- 586,595 ---- * * @author Don Seiler <do...@NO...> + * @module PHPWSBB + * @param int $id : User Id + * @return none */ ! function _getUserSettings($id=null) { ! if(!$_SESSION['OBJ_user']->username || !($id && $_SESSION['OBJ_user']->allow_access('phpwsbb', 'edit_users'))) { $message = $_SESSION['translate']->it('Access to edit settings was denied.'); $error = new PHPWS_Error('phpwsbb', 'PHPWSBB_Manager::_getSettings()', $message, 'exit', 1); *************** *** 594,599 **** } ! // Load all information for this user ! $user = $this->_load_user_settings($_SESSION['OBJ_user']->user_id); $tabs = 1; $form = new EZform('PHPWSBB_Settings_edit'); --- 597,604 ---- } ! // Load all information for the user ! if (!$id) ! $id = $_SESSION['OBJ_user']->user_id; ! $user = $this->_load_user_settings($id); $tabs = 1; $form = new EZform('PHPWSBB_Settings_edit'); *************** *** 703,707 **** } ! $title = $_SESSION['translate']->it('phpwsBB User Settings'); $content = $this->_menu() . PHPWS_Template::processTemplate($tags, 'phpwsbb', 'edit_user_settings.tpl'); --- 708,715 ---- } ! if ($id==$_SESSION['OBJ_user']->user_id) ! $title = $_SESSION['translate']->it('phpwsBB User Settings'); ! else ! $title = $_SESSION['translate']->it('phpwsBB User Settings for "[var1]"', $user['username']); $content = $this->_menu() . PHPWS_Template::processTemplate($tags, 'phpwsbb', 'edit_user_settings.tpl'); *************** *** 1200,1204 **** case 'usersettings': ! $this->_getUserSettings(); break; --- 1208,1215 ---- case 'usersettings': ! if (isset($_REQUEST['user'])) ! $this->_getUserSettings((int)$_REQUEST['user']); ! else ! $this->_getUserSettings(); break; |