Skip to content

Commit bcdd3bf

Browse files
authored
better error message for ensure exists (#316)
1 parent fd489c7 commit bcdd3bf

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

resources/lib/UnityGroup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function cancelGroupJoinRequest($user, $send_mail = true)
229229
// $users = $this->getGroupMembers();
230230

231231
// // now we delete the ldap entry
232-
// \ensure($this->entry->exists());
232+
// $this->entry->ensureExists();
233233
// $this->entry->delete();
234234
// $this->REDIS->removeCacheArray("sorted_groups", "", $this->gid);
235235
// foreach ($users as $user) {

resources/lib/UnityUser.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function setOrg($org)
145145

146146
public function getOrg($ignorecache = false)
147147
{
148-
\ensure($this->exists());
148+
$this->entry->ensureExists();
149149
if (!$ignorecache) {
150150
$cached_val = $this->REDIS->getCache($this->uid, "org");
151151
if (!is_null($cached_val)) {
@@ -194,7 +194,7 @@ public function setFirstname($firstname, $operator = null)
194194
*/
195195
public function getFirstname($ignorecache = false)
196196
{
197-
\ensure($this->exists());
197+
$this->entry->ensureExists();
198198
if (!$ignorecache) {
199199
$cached_val = $this->REDIS->getCache($this->uid, "firstname");
200200
if (!is_null($cached_val)) {
@@ -243,7 +243,7 @@ public function setLastname($lastname, $operator = null)
243243
*/
244244
public function getLastname($ignorecache = false)
245245
{
246-
\ensure($this->exists());
246+
$this->entry->ensureExists();
247247
if (!$ignorecache) {
248248
$cached_val = $this->REDIS->getCache($this->uid, "lastname");
249249
if (!is_null($cached_val)) {
@@ -266,7 +266,7 @@ public function getLastname($ignorecache = false)
266266

267267
public function getFullname()
268268
{
269-
\ensure($this->exists());
269+
$this->entry->ensureExists();
270270
return $this->getFirstname() . " " . $this->getLastname();
271271
}
272272

@@ -298,7 +298,7 @@ public function setMail($email, $operator = null)
298298
*/
299299
public function getMail($ignorecache = false)
300300
{
301-
\ensure($this->exists());
301+
$this->entry->ensureExists();
302302
if (!$ignorecache) {
303303
$cached_val = $this->REDIS->getCache($this->uid, "mail");
304304
if (!is_null($cached_val)) {
@@ -357,7 +357,7 @@ public function setSSHKeys($keys, $operator = null, $send_mail = true)
357357
*/
358358
public function getSSHKeys($ignorecache = false)
359359
{
360-
\ensure($this->exists());
360+
$this->entry->ensureExists();
361361
if (!$ignorecache) {
362362
$cached_val = $this->REDIS->getCache($this->uid, "sshkeys");
363363
if (!is_null($cached_val)) {
@@ -431,7 +431,7 @@ public function setLoginShell($shell, $operator = null, $send_mail = true)
431431
*/
432432
public function getLoginShell($ignorecache = false)
433433
{
434-
\ensure($this->exists());
434+
$this->entry->ensureExists();
435435
if (!$ignorecache) {
436436
$cached_val = $this->REDIS->getCache($this->uid, "loginshell");
437437
if (!is_null($cached_val)) {
@@ -476,7 +476,7 @@ public function setHomeDir($home, $operator = null)
476476
*/
477477
public function getHomeDir($ignorecache = false)
478478
{
479-
\ensure($this->exists());
479+
$this->entry->ensureExists();
480480
if (!$ignorecache) {
481481
$cached_val = $this->REDIS->getCache($this->uid, "homedir");
482482
if (!is_null($cached_val)) {

resources/lib/phpopenldaper

0 commit comments

Comments
 (0)