diff --git a/include/class.attachment.php b/include/class.attachment.php index 5ada65726d67f65b7524992594c9ebb0cdf748e9..005b8215689291a679d629cf0adf73b3bed13c08 100644 --- a/include/class.attachment.php +++ b/include/class.attachment.php @@ -104,6 +104,13 @@ class AttachmentModel extends VerySimpleModel { ); } +class GenericAttachment extends VerySimpleModel { + static $meta = array( + 'table' => ATTACHMENT_TABLE, + 'pk' => array('id'), + ); +} + class GenericAttachments { var $id; diff --git a/include/class.client.php b/include/class.client.php index 39b8241c9da43a839e70770f5632a8d236b94abf..6ad2efc03b5e40ebeda8941ad56f7dd3a0aa4375 100644 --- a/include/class.client.php +++ b/include/class.client.php @@ -319,8 +319,6 @@ class EndUser extends BaseAuthenticatedUser { class ClientAccount extends UserAccount { - var $_extra; - function checkPassword($password, $autoupdate=true) { /*bcrypt based password match*/ @@ -395,12 +393,12 @@ class ClientAccount extends UserAccount { } } - if (!$vars['timezone_id']) - $errors['timezone_id']=__('Time zone selection is required'); + // Timezone selection is not required. System default is a valid + // fallback if ($errors) return false; - $this->set('timezone_id', $vars['timezone_id']); + $this->set('timezone', $vars['timezone']); $this->set('dst', isset($vars['dst']) ? 1 : 0); // Change language $this->set('lang', $vars['lang'] ?: null); diff --git a/include/class.faq.php b/include/class.faq.php index 9f4b3030577e3b2fa0bb45148e26c7bdae0aca89..34e56f93e09a71e79e7e15dc7b2598c0cf9b0431 100644 --- a/include/class.faq.php +++ b/include/class.faq.php @@ -29,14 +29,15 @@ class FAQ extends VerySimpleModel { 'constraint' => array( 'category_id' => 'Category.category_id' ), - ), /* XXX: Not yet implemented + ), 'attachments' => array( 'constraint' => array( "'F'" => 'GenericAttachment.type', 'faq_id' => 'GenericAttachment.object_id', ), 'list' => true, - ), */ + 'null' => true, + ), 'topics' => array( 'constraint' => array( 'faq_id' => 'FaqTopic.faq_id' diff --git a/include/class.user.php b/include/class.user.php index 0010004372ace9b061a07a2a51fb6c6719ebc825..d12bd009e579b6343788d9a87dab3ce6a989be56 100644 --- a/include/class.user.php +++ b/include/class.user.php @@ -788,6 +788,7 @@ class UserAccountModel extends VerySimpleModel { ); var $_status; + var $_extra; function __construct() { call_user_func_array(array('parent', '__construct'), func_get_args()); @@ -860,7 +861,7 @@ class UserAccountModel extends VerySimpleModel { function getExtraAttr($attr=false, $default=null) { if (!isset($this->_extra)) - $this->_extra = JsonDataParser::decode($this->extra); + $this->_extra = JsonDataParser::decode($this->get('extra', '')); return $attr ? (@$this->_extra[$attr] ?: $default) : $this->_extra; } @@ -984,8 +985,8 @@ class UserAccount extends UserAccountModel { // TODO: Make sure the username is unique - if (!$vars['timezone']) - $errors['timezone'] = __('Time zone selection is required'); + // Timezone selection is not required. System default is a valid + // fallback // Changing password? if ($vars['passwd1'] || $vars['passwd2']) { diff --git a/include/staff/templates/user-account.tmpl.php b/include/staff/templates/user-account.tmpl.php index 82674810bc82844d2a0afec587dfbfdeca6b1b1c..6319aeb960daf8b427dc67169770b0e4f91d6100 100644 --- a/include/staff/templates/user-account.tmpl.php +++ b/include/staff/templates/user-account.tmpl.php @@ -15,6 +15,7 @@ if ($info['error']) { } elseif ($info['msg']) { echo sprintf('<p id="msg_notice">%s</p>', $info['msg']); } ?> +<form method="post" class="user" action="#users/<?php echo $user->getId(); ?>/manage" > <ul class="tabs" id="user-account-tabs"> <li <?php echo !$access? 'class="active"' : ''; ?>><a href="#user-account" ><i class="icon-user"></i> <?php echo __('User Information'); ?></a></li>