Commit a7603e9cd6a7b0abd73205d74f5c427a311f90ec
1 parent
2f2fdaed
change getuserID function to use functions from lookups.inc
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@301 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
4 additions
and
26 deletions
lib/administration/UserManager.inc
| ... | ... | @@ -13,7 +13,7 @@ require_once("$default->owl_fs_root/lib/authentication/class.AuthLdap.php"); |
| 13 | 13 | * @package dmslib |
| 14 | 14 | */ |
| 15 | 15 | |
| 16 | -//common admin functions that dont really form part of class | |
| 16 | +// uses function from groupamanager class | |
| 17 | 17 | require_once ("$default->owl_fs_root/lib/administration/GroupManager.inc"); |
| 18 | 18 | |
| 19 | 19 | class UserManager |
| ... | ... | @@ -503,33 +503,11 @@ class UserManager |
| 503 | 503 | |
| 504 | 504 | function getUserID($username) |
| 505 | 505 | { |
| 506 | - global $default; | |
| 506 | + global $default; | |
| 507 | 507 | |
| 508 | - $sql = new Owl_DB; | |
| 509 | - | |
| 510 | - | |
| 511 | - // check that username exists if it does'nt return false | |
| 512 | - $query = "SELECT id FROM $default->owl_users_table WHERE username = '" . $username . "'"; | |
| 513 | - $sql->query($query); | |
| 514 | - $rows = $sql->num_rows($sql); | |
| 515 | - // go into record set | |
| 516 | - $sql->next_record(); | |
| 517 | - | |
| 518 | - // store the id in a variable | |
| 519 | - $id = $sql->f("id"); | |
| 508 | + $id = lookupID($default->owl_users_table, "name", $username); | |
| 520 | 509 | |
| 521 | - // if no entry..username does not exist | |
| 522 | - if ($rows == 0) | |
| 523 | - { | |
| 524 | - // duplicate username | |
| 525 | - $default->errorMessage = "UserManager::The username " . $username . " does not exist<br>"; | |
| 526 | - $default->log->debug($default->errorMessage); | |
| 527 | - return false; | |
| 528 | - } | |
| 529 | - else | |
| 530 | - { | |
| 531 | - return $id; | |
| 532 | - } | |
| 510 | + return $id; | |
| 533 | 511 | } |
| 534 | 512 | |
| 535 | 513 | /* | ... | ... |