mirror of
https://github.com/humhub/humhub.git
synced 2025-03-14 20:19:47 +01:00
Visibility not correctly saved on space creation
This commit is contained in:
parent
ad4a03e88a
commit
03cb7d5646
@ -10,6 +10,33 @@
|
||||
class CreateController extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array action filters
|
||||
*/
|
||||
public function filters()
|
||||
{
|
||||
return array(
|
||||
'accessControl', // perform access control for CRUD operations
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the access control rules.
|
||||
* This method is used by the 'accessControl' filter.
|
||||
* @return array access control rules
|
||||
*/
|
||||
public function accessRules()
|
||||
{
|
||||
return array(
|
||||
array('allow', // allow authenticated user to perform 'create' and 'update' actions
|
||||
'users' => array('@'),
|
||||
),
|
||||
array('deny', // deny all users
|
||||
'users' => array('*'),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function actionIndex()
|
||||
{
|
||||
$this->redirect($this->createUrl('create/create'));
|
||||
@ -38,12 +65,6 @@ class CreateController extends Controller
|
||||
|
||||
$model->attributes = $_POST['Space'];
|
||||
|
||||
if (Yii::app()->user->canCreatePublicSpace()) {
|
||||
$model->visibility = Space::VISIBILITY_ALL;
|
||||
} else {
|
||||
$model->visibility = Space::VISIBILITY_NONE;
|
||||
}
|
||||
|
||||
if ($model->validate() && $model->save()) {
|
||||
|
||||
// Save in this user variable, that the workspace was new created
|
||||
@ -52,7 +73,6 @@ class CreateController extends Controller
|
||||
// Redirect to the new created Space
|
||||
$this->htmlRedirect($model->getUrl());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$this->renderPartial('create', array('model' => $model), false, true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user