| @@ 93-104 (lines=12) @@ | ||
| 90 | * |
|
| 91 | * @return boolean |
|
| 92 | */ |
|
| 93 | public function controlAuthority($name) |
|
| 94 | { |
|
| 95 | $user = new User(); |
|
| 96 | $user->setDb($this->di->get("db")); |
|
| 97 | $user->find("name", $name); |
|
| 98 | ||
| 99 | // IF AUTHORITY == admin, then continue |
|
| 100 | if ($user->authority != "admin") { |
|
| 101 | return ($user->name == $this->user); |
|
| 102 | } |
|
| 103 | return true; |
|
| 104 | } |
|
| 105 | } |
|
| 106 | ||
| @@ 119-129 (lines=11) @@ | ||
| 116 | * |
|
| 117 | * @return boolean |
|
| 118 | */ |
|
| 119 | public function controlAuthority($name) |
|
| 120 | { |
|
| 121 | $user = new User($this->db); |
|
| 122 | $user->find("name", $name); |
|
| 123 | ||
| 124 | // IF AUTHORITY == admin, then continue |
|
| 125 | if ($user->authority != "admin") { |
|
| 126 | return ($user->name == $this->user); |
|
| 127 | } |
|
| 128 | return true; |
|
| 129 | } |
|
| 130 | } |
|
| 131 | ||