cc-4431: Fixed isUserType

This commit is contained in:
Rudi Grinberg 2012-09-14 16:47:55 -04:00
parent b61abe2474
commit bf651a96aa
2 changed files with 24 additions and 41 deletions

View file

@ -72,34 +72,11 @@ class Application_Model_User
public function isUserType($type)
{
if (is_array($type)) {
$result = false;
foreach ($type as $t) {
switch ($t) {
case UTYPE_ADMIN:
$result = $this->_userInstance->getDbType() === 'A';
break;
case UTYPE_HOST:
$result = $this->_userInstance->getDbType() === 'H';
break;
case UTYPE_PROGRAM_MANAGER:
$result = $this->_userInstance->getDbType() === 'P';
break;
}
if ($result) {
return $result;
}
}
} else {
switch ($type) {
case UTYPE_ADMIN:
return $this->_userInstance->getDbType() === 'A';
case UTYPE_HOST:
return $this->_userInstance->getDbId() === 'H';
case UTYPE_PROGRAM_MANAGER:
return $this->_userInstance->getDbType() === 'P';
}
if (!is_array($type)) {
$type = array($type);
}
$real_type = $this->_userInstance->getDbType();
return in_array($real_type, $type);
}
public function setLogin($login)