mirror of
https://github.com/humhub/humhub.git
synced 2025-03-14 12:09:44 +01:00
commit
43e4a77531
@ -1,3 +1,2 @@
|
||||
<?php return array (
|
||||
|
||||
); ?>
|
@ -240,19 +240,30 @@ class HSetting extends HActiveRecord
|
||||
}
|
||||
|
||||
/**
|
||||
* Saving the registry object
|
||||
* Also deletes cache Entry
|
||||
*
|
||||
* @param type $runValidation
|
||||
* @param type $attributes
|
||||
* @return type
|
||||
* clears cache
|
||||
* @return void
|
||||
*/
|
||||
public function save($runValidation = true, $attributes = null)
|
||||
public function clearCache()
|
||||
{
|
||||
|
||||
Yii::app()->cache->delete($this->getCacheId());
|
||||
RuntimeCache::Remove($this->getCacheId());
|
||||
return parent::save($runValidation, $attributes);
|
||||
}
|
||||
|
||||
public function beforeSave()
|
||||
{
|
||||
|
||||
$this->clearCache();
|
||||
|
||||
if ($this->hasAttribute('created_by') && empty($this->created_by))
|
||||
$this->created_by = 0;
|
||||
|
||||
if ($this->hasAttribute('updated_by') && empty($this->updated_by))
|
||||
$this->updated_by = 0;
|
||||
|
||||
if ($this->hasAttribute('updated_at') && empty($this->updated_at))
|
||||
$this->updated_at = new CDbExpression('NOW()');
|
||||
|
||||
return parent::beforeSave();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -190,6 +190,8 @@ class ConfigController extends Controller
|
||||
|
||||
$form['User']->model->status = User::STATUS_ENABLED;
|
||||
$form['User']->model->super_admin = true;
|
||||
$form['User']->model->language = '';
|
||||
$form['User']->model->last_activity_email = new CDbExpression('NOW()');
|
||||
$form['User']->model->save();
|
||||
|
||||
$form['Profile']->model->user_id = $form['User']->model->id;
|
||||
@ -318,6 +320,7 @@ class ConfigController extends Controller
|
||||
$cGeneral->sort_order = 100;
|
||||
$cGeneral->visibility = 1;
|
||||
$cGeneral->is_system = true;
|
||||
$cGeneral->description = '';
|
||||
$cGeneral->save();
|
||||
|
||||
$cCommunication = new ProfileFieldCategory;
|
||||
@ -325,6 +328,7 @@ class ConfigController extends Controller
|
||||
$cCommunication->sort_order = 200;
|
||||
$cCommunication->visibility = 1;
|
||||
$cCommunication->is_system = true;
|
||||
$cCommunication->description = '';
|
||||
$cCommunication->save();
|
||||
|
||||
$cSocial = new ProfileFieldCategory;
|
||||
@ -332,6 +336,7 @@ class ConfigController extends Controller
|
||||
$cSocial->sort_order = 300;
|
||||
$cSocial->visibility = 1;
|
||||
$cSocial->is_system = true;
|
||||
$cSocial->description = '';
|
||||
$cSocial->save();
|
||||
|
||||
// Add Fields
|
||||
|
Loading…
x
Reference in New Issue
Block a user