SAAS-461: Re-enable timezone and language settings for Super Admins

This commit is contained in:
Albert Santoni 2014-07-28 12:37:40 -04:00
parent 4b4554476a
commit d320651735
3 changed files with 22 additions and 6 deletions

View file

@ -124,11 +124,7 @@ class UserController extends Zend_Controller_Action
}
public function editUserAction()
{
if (Application_Model_User::getCurrentUser()->isSuperAdmin()) {
$this->_redirect('billing/client');
}
{
$request = $this->getRequest();
$form = new Application_Form_EditUser();
if ($request->isPost()) {

View file

@ -38,7 +38,7 @@ class Application_Form_EditUser extends Zend_Form
$login->addFilter('StringTrim');
$login->setDecorators(array('viewHelper'));
$this->addElement($login);
$password = new Zend_Form_Element_Password('cu_password');
$password->setLabel(_('Password:'));
$password->setAttrib('class', 'input_text');
@ -123,6 +123,17 @@ class Application_Form_EditUser extends Zend_Form
$timezone->setValue(Application_Model_Preference::GetUserTimezone($currentUserId));
$timezone->setDecorators(array('ViewHelper'));
$this->addElement($timezone);
if (Application_Model_User::getCurrentUser()->isSuperAdmin()) {
$elemsToDisable = array($password, $passwordVerify, $email, $firstName, $lastName,
$cellPhone, $skype, $jabber);
foreach ($elemsToDisable as $element) {
//$this->_redirect('billing/client');
$element->setAttrib('disabled', 'disabled');
$element->setAttrib('readonly', 'readonly');
}
}
}
public function validateLogin($p_login, $p_userId) {

View file

@ -1,5 +1,14 @@
<h2><?php echo sprintf(_("%s's Settings"), $this->escape($this->currentUser)) ?></h2>
<div id="current-user-container">
<?php if(Application_Model_User::getCurrentUser()->isSuperAdmin()) : ?>
<div class="user-data" id="user_details_superadmin_message" style="text-align: center;">
<?=sprintf(_("Account details can be changed in your <a href=\"%s\">Billing Settings</a>."), "/billing/client");?>
<br><br>
</div>
<?php endif; ?>
<form id="current-user-form" class="edit-user-global" method="post" enctype="application/x-www-form-urlencoded">
<dl class="zend_form">
<?php echo $this->element->getElement('cu_user_id') ?>