Fix user settings again for Super Admins, also Zend routing tweak

* Better fix for language and interface settings not being able to change for Super Admins
* Fixes Zend routing on Trusty, for whatever reason
This commit is contained in:
Albert Santoni 2014-08-01 12:50:02 -04:00
parent d320651735
commit 1c676dee6d
4 changed files with 12 additions and 3 deletions

View file

@ -6,11 +6,11 @@ bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
;resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.plugins.putHandler = "Zend_Controller_Plugin_PutHandler"
;load everything in the modules directory including models
resources.modules[] = ""
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.modules[] = ""
resources.view[] =
; These are no longer needed. They are specified in /etc/airtime/airtime.conf:
;resources.db.adapter = "Pdo_Pgsql"

View file

@ -133,6 +133,14 @@ class UserController extends Zend_Controller_Action
if ($form->isValid($formData) &&
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
$user = new Application_Model_User($formData['cu_user_id']);
//Stupid hack because our schema enforces non-null first_name
//even though by default the admin user has no first name... (....)
if (Application_Model_User::getCurrentUser()->isSuperAdmin()) {
if (empty($formData['cu_first_name'])) {
$formData['cu_first_name'] = "admin";
$formData['cu_last_name'] = "admin"; //ditto, avoid non-null DB constraint
}
}
$user->setFirstName($formData['cu_first_name']);
$user->setLastName($formData['cu_last_name']);
// We don't allow 6 x's as a password.

View file

@ -131,6 +131,7 @@ class Application_Form_EditUser extends Zend_Form
//$this->_redirect('billing/client');
$element->setAttrib('disabled', 'disabled');
$element->setAttrib('readonly', 'readonly');
$element->setRequired(false);
}
}

View file

@ -3,7 +3,7 @@
<?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");?>
<?=sprintf(_("<b>Note:</b> You are a special \"Super Admin\" type of user.<br>Account details for Super Admins can be changed in your <a href=\"%s\">Billing Settings</a> instead."), "/billing/client");?>
<br><br>
</div>
<?php endif; ?>