|
From: Verdon V. <ve...@us...> - 2008-10-09 19:41:01
|
Update of /cvsroot/phpwebsite-comm/modules/rolodex/class In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27908/class Modified Files: RDX_Forms.php RDX_Member.php RDX_Runtime.php Rolodex.php Log Message: 1.2.0 updates Index: RDX_Forms.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Forms.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** RDX_Forms.php 11 Aug 2008 14:54:08 -0000 1.24 --- RDX_Forms.php 9 Oct 2008 19:40:47 -0000 1.25 *************** *** 42,50 **** case 'edit_member': if (empty($this->rolodex->member)) { ! $this->rolodex->loadMember($_POST['user_id']); // I don't think the id in here matters but am unsure? } if (!isset($this->rolodex->member->user_id)) { ! $this->rolodex->member->user_id = $_POST['user_id']; } $admin = true; --- 42,50 ---- case 'edit_member': if (empty($this->rolodex->member)) { ! $this->rolodex->loadMember($_REQUEST['user_id']); // I don't think the id in here matters but am unsure? } if (!isset($this->rolodex->member->user_id)) { ! $this->rolodex->member->user_id = $_REQUEST['user_id']; } $admin = true; *************** *** 54,61 **** case 'edit_my_member': if (empty($this->rolodex->member)) { ! $this->rolodex->loadMember($_POST['user_id']); // I don't think the id in here matters but am unsure? } if (!isset($this->rolodex->member->user_id)) { ! $this->rolodex->member->user_id = $_POST['user_id']; } if ($this->rolodex->member->isMine()) { --- 54,61 ---- case 'edit_my_member': if (empty($this->rolodex->member)) { ! $this->rolodex->loadMember($_REQUEST['user_id']); // I don't think the id in here matters but am unsure? } if (!isset($this->rolodex->member->user_id)) { ! $this->rolodex->member->user_id = $_REQUEST['user_id']; } if ($this->rolodex->member->isMine()) { *************** *** 834,838 **** $form->addHidden('aop', 'edit_member'); ! PHPWS_Core::initModClass('user', 'Users.php'); $db = new PHPWS_DB('users'); $db->addColumn('id'); --- 834,839 ---- $form->addHidden('aop', 'edit_member'); ! // I don't seem to need the class ! // PHPWS_Core::initModClass('users', 'Users.php'); $db = new PHPWS_DB('users'); $db->addColumn('id'); *************** *** 1119,1122 **** --- 1120,1128 ---- } + if (Current_User::allow('users', 'edit_users')) { + $tpl['EDIT_USER'] = $member->editUserLink(); + $tpl['ACTIVE_LINK'] = $member->activeLink(); + } + if (Current_User::allow('rolodex', 'edit_member')) { $js_vars['form_name'] = 'rolodex_member'; *************** *** 1241,1244 **** --- 1247,1270 ---- function contactMember() { + if (isset($_POST['name'])) { + $_POST['name'] = $_POST['name']; + } else { + $_POST['name'] = null; + } + if (isset($_POST['email'])) { + $_POST['email'] = $_POST['email']; + } else { + $_POST['email'] = null; + } + if (isset($_POST['subject'])) { + $_POST['subject'] = $_POST['subject']; + } else { + $_POST['subject'] = null; + } + if (isset($_POST['message'])) { + $_POST['message'] = $_POST['message']; + } else { + $_POST['message'] = null; + } $form = new PHPWS_Form; $form->addHidden('module', 'rolodex'); Index: RDX_Runtime.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Runtime.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RDX_Runtime.php 6 Jul 2008 13:05:17 -0000 1.3 --- RDX_Runtime.php 9 Oct 2008 19:40:47 -0000 1.4 *************** *** 45,49 **** $db->addColumn('user_id'); $db->addWhere('active', 1); ! if (!$_SESSION['User']->id) { $db->addWhere('privacy', 0); } else { --- 45,49 ---- $db->addColumn('user_id'); $db->addWhere('active', 1); ! if (!Current_User::isLogged()) { $db->addWhere('privacy', 0); } else { Index: Rolodex.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/Rolodex.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Rolodex.php 26 Jul 2008 20:57:18 -0000 1.20 --- Rolodex.php 9 Oct 2008 19:40:47 -0000 1.21 *************** *** 532,536 **** case 'post_member': ! if (Current_User::getId() !== $_POST['user_id']) { Current_User::disallow(); } --- 532,539 ---- case 'post_member': ! // print(Current_User::getId() . ':' . $_REQUEST['user_id']); exit; ! // print($_SESSION['User']->id . ':' . $_REQUEST['user_id']); exit; ! // if (Current_User::getId() !== $_REQUEST['user_id']) { ! if ($_SESSION['User']->id != $_REQUEST['user_id']) { Current_User::disallow(); } *************** *** 739,743 **** } ! if (Current_User::allow('rolodex', 'settings', null, null, true)){ $tags['info'] = array('title'=>dgettext('rolodex', 'Read me'), 'link'=>$link); --- 742,746 ---- } ! if (Current_User::isDeity()){ $tags['info'] = array('title'=>dgettext('rolodex', 'Read me'), 'link'=>$link); *************** *** 1003,1011 **** return false; } else { ! if (PHPWS_Settings::save('rolodex')) { ! return true; ! } else { ! return falsel; ! } } --- 1006,1011 ---- return false; } else { ! PHPWS_Settings::save('rolodex'); ! return true; } *************** *** 1592,1596 **** } ! if (Current_User::allow('rolodex', 'settings', null, null, true) && !$_REQUEST['aop']){ $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Settings'), "rolodex", array('aop'=>'menu', 'tab'=>'settings')); } --- 1592,1596 ---- } ! if (Current_User::allow('rolodex', 'settings', null, null, true) && !isset($_REQUEST['aop'])){ $links[] = PHPWS_Text::moduleLink(dgettext('rolodex', 'Settings'), "rolodex", array('aop'=>'menu', 'tab'=>'settings')); } Index: RDX_Member.php =================================================================== RCS file: /cvsroot/phpwebsite-comm/modules/rolodex/class/RDX_Member.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** RDX_Member.php 25 Jul 2008 12:28:15 -0000 1.17 --- RDX_Member.php 9 Oct 2008 19:40:47 -0000 1.18 *************** *** 1341,1344 **** --- 1341,1345 ---- $vars2['id'] = $this->user_id; $vars2['uop'] = 'view_rss'; + $links = null; if (Current_User::allow('rolodex', 'edit_member')){ *************** *** 1554,1557 **** --- 1555,1559 ---- function editLink() { + $link = null; if (Current_User::allow('rolodex', 'edit_member') || $this->isMine()) { if ($this->isMine()) { *************** *** 1569,1574 **** --- 1571,1641 ---- + function editUserLink() + { + $link = null; + if (Current_User::allow('users', 'edit_users')) { + $user = new PHPWS_User($this->user_id); + $vars['user_id'] = $this->user_id; + $vars['action'] = 'admin'; + $vars['command'] = 'editUser'; + $link = PHPWS_Text::secureLink(sprintf(dgettext('rolodex', 'Edit email and password for %s (%s)'), $user->display_name, $user->username), 'users', $vars); + } + return $link; + } + + + function activateUserLink() + { + $link = null; + if (Current_User::allow('users', 'edit_users')) { + $user = new PHPWS_User($this->user_id); + $vars['user_id'] = $this->user_id; + $vars['action'] = 'admin'; + $vars['command'] = 'activateUser'; + $link = PHPWS_Text::secureLink(sprintf(dgettext('rolodex', 'Activate user %s (%s)'), $user->display_name, $user->username), 'users', $vars); + } + return $link; + } + + + function deactivateUserLink() + { + $link = null; + if (Current_User::allow('users', 'edit_users')) { + $user = new PHPWS_User($this->user_id); + $vars['user_id'] = $this->user_id; + $vars['action'] = 'admin'; + $vars['command'] = 'deactivateUser'; + $link = PHPWS_Text::secureLink(sprintf(dgettext('rolodex', 'Deactivate user %s (%s)'), $user->display_name, $user->username), 'users', $vars); + } + return $link; + } + + + function activeLink() + { + $link = null; + if (Current_User::allow('users', 'edit_users')) { + $user = new PHPWS_User($this->user_id); + if ($user->active) { + $vars['user_id'] = $this->user_id; + $vars['action'] = 'admin'; + $vars['command'] = 'deactivateUser'; + $link = PHPWS_Text::secureLink(sprintf(dgettext('rolodex', 'Deactivate user %s (%s)'), $user->display_name, $user->username), 'users', $vars); + } else { + $vars['user_id'] = $this->user_id; + $vars['action'] = 'admin'; + $vars['command'] = 'activateUser'; + $link = PHPWS_Text::secureLink(sprintf(dgettext('rolodex', 'Activate user %s (%s)'), $user->display_name, $user->username), 'users', $vars); + } + } + return $link; + } + + function getGoogleMap($location='mailing') { + $address = null; + if ($location == 'mailing') { if (!empty($this->mailing_address_1)) |