cc-4301: Fixed bug where owner_id would be null whenever show is recorded.

This commit is contained in:
Rudi Grinberg 2012-08-27 17:58:09 -04:00
parent 583d3837be
commit 7f66bdbb66
3 changed files with 19 additions and 4 deletions

View file

@ -241,6 +241,15 @@ class Application_Model_User
public static function getUsersOfType($type) {
return CcSubjsQuery::create()->filterByDbType($type)->find();
}
public static function getFirstAdminId() {
$admins = Application_Model_User::getUsersOfType('A');
if (count($admins) > 0) { // found admin => pick first one
return $admins[0]->getDbId();
} else {
Logging::warn("Warning. no admins found in database");
return null;
}
}
public static function getUsers(array $type, $search=null)
{
$con = Propel::getConnection();
@ -342,7 +351,6 @@ class Application_Model_User
public static function getCurrentUser()
{
$userinfo = Zend_Auth::getInstance()->getStorage()->read();
if (is_null($userinfo)) {
return null;
}