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:
parent
d320651735
commit
1c676dee6d
4 changed files with 12 additions and 3 deletions
|
@ -6,11 +6,11 @@ bootstrap.class = "Bootstrap"
|
||||||
appnamespace = "Application"
|
appnamespace = "Application"
|
||||||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
|
||||||
resources.frontController.params.displayExceptions = 0
|
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"
|
resources.frontController.plugins.putHandler = "Zend_Controller_Plugin_PutHandler"
|
||||||
;load everything in the modules directory including models
|
;load everything in the modules directory including models
|
||||||
resources.modules[] = ""
|
|
||||||
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
|
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
|
||||||
|
resources.modules[] = ""
|
||||||
resources.view[] =
|
resources.view[] =
|
||||||
; These are no longer needed. They are specified in /etc/airtime/airtime.conf:
|
; These are no longer needed. They are specified in /etc/airtime/airtime.conf:
|
||||||
;resources.db.adapter = "Pdo_Pgsql"
|
;resources.db.adapter = "Pdo_Pgsql"
|
||||||
|
|
|
@ -133,6 +133,14 @@ class UserController extends Zend_Controller_Action
|
||||||
if ($form->isValid($formData) &&
|
if ($form->isValid($formData) &&
|
||||||
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
$form->validateLogin($formData['cu_login'], $formData['cu_user_id'])) {
|
||||||
$user = new Application_Model_User($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->setFirstName($formData['cu_first_name']);
|
||||||
$user->setLastName($formData['cu_last_name']);
|
$user->setLastName($formData['cu_last_name']);
|
||||||
// We don't allow 6 x's as a password.
|
// We don't allow 6 x's as a password.
|
||||||
|
|
|
@ -131,6 +131,7 @@ class Application_Form_EditUser extends Zend_Form
|
||||||
//$this->_redirect('billing/client');
|
//$this->_redirect('billing/client');
|
||||||
$element->setAttrib('disabled', 'disabled');
|
$element->setAttrib('disabled', 'disabled');
|
||||||
$element->setAttrib('readonly', 'readonly');
|
$element->setAttrib('readonly', 'readonly');
|
||||||
|
$element->setRequired(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
<?php if(Application_Model_User::getCurrentUser()->isSuperAdmin()) : ?>
|
<?php if(Application_Model_User::getCurrentUser()->isSuperAdmin()) : ?>
|
||||||
<div class="user-data" id="user_details_superadmin_message" style="text-align: center;">
|
<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>
|
<br><br>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue