| @@ 102-113 (lines=12) @@ | ||
| 99 | * |
|
| 100 | * @return boolean |
|
| 101 | */ |
|
| 102 | public function controlAuthority($name) |
|
| 103 | {
|
|
| 104 | $user = new User(); |
|
| 105 | $user->setDb($this->di->get("db"));
|
|
| 106 | $user->find("name", $name);
|
|
| 107 | ||
| 108 | // IF AUTHORITY == admin, then continue |
|
| 109 | if ($user->authority != "admin") {
|
|
| 110 | return ($user->name == $this->user); |
|
| 111 | } |
|
| 112 | return true; |
|
| 113 | } |
|
| 114 | } |
|
| 115 | ||
| @@ 127-138 (lines=12) @@ | ||
| 124 | * |
|
| 125 | * @return boolean |
|
| 126 | */ |
|
| 127 | public function controlAuthority($name) |
|
| 128 | { |
|
| 129 | $user = new User(); |
|
| 130 | $user->setDb($this->di->get("db")); |
|
| 131 | $user->find("name", $name); |
|
| 132 | ||
| 133 | // IF AUTHORITY == admin, then continue |
|
| 134 | if ($user->authority != "admin") { |
|
| 135 | return ($user->name == $this->user); |
|
| 136 | } |
|
| 137 | return true; |
|
| 138 | } |
|
| 139 | } |
|
| 140 | ||