00001 <?
00007 include_once("core/system/JError.class.php");
00008
00009
00010 define(ERROR_USER_NOT_FOUND, 1);
00011 define(ERROR_NOT_INITIALIZED, 2);
00012 define(ERROR_GROUP_NOT_FOUND, 3);
00013 define(ERROR_ROLE_NOT_FOUND, 4);
00014 define(ERROR_ALREADY_IN_GROUP, 5);
00015 define(ERROR_NOT_IN_GROUP, 6);
00016 define(ERROR_MODULE_NOT_FOUND, 7);
00017 define(ERROR_STILL_USERS_WITH_ROLE, 8);
00018 define(ERROR_SESSION_EXPIRED, 9);
00019 define(ERROR_IS_GLOBAL_GROUP, 10);
00020 define(ERROR_NOT_GLOBAL_GROUP, 10);
00021 define(ERROR_GROUP_HAS_SUBGROUPS, 11);
00022
00026 class JSystemError extends JError
00027 {
00035 function JSystemError($code)
00036 {
00037 $msg = JSystemError::_GetMessage($code);
00038 parent::JError($code, $msg);
00039 }
00040
00046 function _GetMessage($code)
00047 {
00048 switch($code)
00049 {
00050 case ERROR_USER_NOT_FOUND:
00051 $msg = gettext("The specified user was not found");
00052 break;
00053 case ERROR_NOT_INITIALIZED:
00054 $msg = gettext("Object not initialized");
00055 break;
00056 case ERROR_GROUP_NOT_FOUND:
00057 $msg = gettext("The group does not exist");
00058 break;
00059 case ERROR_ROLE_NOT_FOUND:
00060 $msg = gettext("The role does not exist");
00061 break;
00062 case ERROR_ALREADY_IN_GROUP:
00063 $msg = gettext("The user already belongs to this group");
00064 break;
00065 case ERROR_NOT_IN_GROUP:
00066 $msg = gettext("The user does not belong to this group");
00067 break;
00068 case ERROR_MODULE_NOT_FOUND:
00069 $msg = gettext("The module does not exist");
00070 break;
00071 case ERROR_STILL_USERS_WITH_ROLE:
00072 $msg = gettext("There still are users with this role in some group");
00073 break;
00074 case ERROR_SESSION_EXPIRED:
00075 $msg = gettext("Current session has expired");
00076 break;
00077 case ERROR_IS_GLOBAL_GROUP:
00078 $msg = gettext("The group is a global group");
00079 break;
00080 case ERROR_NOT_GLOBAL_GROUP:
00081 $msg = gettext("The group is not a global group");
00082 break;
00083 case ERROR_GROUP_HAS_SUBGROUPS:
00084 $msg = gettext("The group has subgroups");
00085 break;
00086 default:
00087 $msg = gettext("Unknown error");
00088 }
00089
00090 return $msg;
00091 }
00092 }
00093 ?>