Skip to content
Snippets Groups Projects
Commit 3323e013 authored by Jared Hancock's avatar Jared Hancock
Browse files

oops: Fix a few small issues

  * Fix missing attachments join for Category (fixes #1654)
  * Fix crash on user account registration
  * Fix save button on user account (fixes #1655) — regression from bebc2d79
parent 16485eb5
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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);
......
......@@ -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'
......
......@@ -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']) {
......
......@@ -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>&nbsp;<?php echo __('User Information'); ?></a></li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment