@@ -27,16 +27,16 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | function validate_user_is_admin($user) |
| 29 | 29 | { |
| 30 | - return $user->isInGroupNamed('ThemeAdmins'); |
|
| 30 | + return $user->isInGroupNamed('ThemeAdmins'); |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | function validate_user_has_access($user, $obj) |
| 34 | 34 | { |
| 35 | - if($user->isInGroupNamed('ThemeAdmins')) |
|
| 36 | - { |
|
| 37 | - return true; |
|
| 38 | - } |
|
| 39 | - return in_array($user->getUid(), $obj['registrars']); |
|
| 35 | + if($user->isInGroupNamed('ThemeAdmins')) |
|
| 36 | + { |
|
| 37 | + return true; |
|
| 38 | + } |
|
| 39 | + return in_array($user->getUid(), $obj['registrars']); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | function list_obj() |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | $params = $app->request->params(); |
| 50 | 50 | if(isset($params['fmt'])) |
| 51 | 51 | { |
| 52 | - unset($params['fmt']); |
|
| 52 | + unset($params['fmt']); |
|
| 53 | 53 | } |
| 54 | 54 | if(isset($params['_'])) |
| 55 | 55 | { |
| 56 | - unset($params['_']); |
|
| 56 | + unset($params['_']); |
|
| 57 | 57 | } |
| 58 | 58 | $logo_urls = false; |
| 59 | 59 | $db = new ThemeDB(); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | { |
| 145 | 145 | if(!validate_user_is_admin($app->user)) |
| 146 | 146 | { |
| 147 | - trim_obj($obj); |
|
| 147 | + trim_obj($obj); |
|
| 148 | 148 | } |
| 149 | 149 | else if($field === false) |
| 150 | 150 | { |
@@ -84,14 +84,14 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | function addObjectToCollection($collection, $obj) |
| 86 | 86 | { |
| 87 | - unset($obj['_id']); |
|
| 88 | - $table = $this->dataSet[$collection]; |
|
| 89 | - $res = $table->create($obj); |
|
| 90 | - if($res !== false) |
|
| 91 | - { |
|
| 92 | - return $res; |
|
| 93 | - } |
|
| 94 | - return false; |
|
| 87 | + unset($obj['_id']); |
|
| 88 | + $table = $this->dataSet[$collection]; |
|
| 89 | + $res = $table->create($obj); |
|
| 90 | + if($res !== false) |
|
| 91 | + { |
|
| 92 | + return $res; |
|
| 93 | + } |
|
| 94 | + return false; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | function updateObjectInCollection($collection, $obj) |
@@ -137,13 +137,13 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | function addTheme($theme) |
| 139 | 139 | { |
| 140 | - unset($theme['_id']); |
|
| 141 | - $res = $this->db->themes->insert($theme); |
|
| 142 | - if($res['ok'] === true) |
|
| 143 | - { |
|
| 144 | - return $theme['_id']; |
|
| 145 | - } |
|
| 146 | - return false; |
|
| 140 | + unset($theme['_id']); |
|
| 141 | + $res = $this->db->themes->insert($theme); |
|
| 142 | + if($res['ok'] === true) |
|
| 143 | + { |
|
| 144 | + return $theme['_id']; |
|
| 145 | + } |
|
| 146 | + return false; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | function updateTheme($theme) |