ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ErrorCodes.php
Go to the documentation of this file.
1 <?php
9 namespace SimpleSAML\Error;
10 
12 {
18  final public static function defaultGetAllErrorCodeTitles()
19  {
20  return array(
21  'ACSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:title_ACSPARAMS}'),
22  'ARSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:title_ARSPARAMS}'),
23  'AUTHSOURCEERROR' => \SimpleSAML\Locale\Translate::noop('{errors:title_AUTHSOURCEERROR}'),
24  'BADREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:title_BADREQUEST}'),
25  'CASERROR' => \SimpleSAML\Locale\Translate::noop('{errors:title_CASERROR}'),
26  'CONFIG' => \SimpleSAML\Locale\Translate::noop('{errors:title_CONFIG}'),
27  'CREATEREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:title_CREATEREQUEST}'),
28  'DISCOPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:title_DISCOPARAMS}'),
29  'GENERATEAUTHNRESPONSE' => \SimpleSAML\Locale\Translate::noop('{errors:title_GENERATEAUTHNRESPONSE}'),
30  'INVALIDCERT' => \SimpleSAML\Locale\Translate::noop('{errors:title_INVALIDCERT}'),
31  'LDAPERROR' => \SimpleSAML\Locale\Translate::noop('{errors:title_LDAPERROR}'),
32  'LOGOUTINFOLOST' => \SimpleSAML\Locale\Translate::noop('{errors:title_LOGOUTINFOLOST}'),
33  'LOGOUTREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:title_LOGOUTREQUEST}'),
34  'MEMCACHEDOWN' => \SimpleSAML\Locale\Translate::noop('{errors:title_MEMCACHEDOWN}'),
35  'METADATA' => \SimpleSAML\Locale\Translate::noop('{errors:title_METADATA}'),
36  'METADATANOTFOUND' => \SimpleSAML\Locale\Translate::noop('{errors:title_METADATANOTFOUND}'),
37  'NOACCESS' => \SimpleSAML\Locale\Translate::noop('{errors:title_NOACCESS}'),
38  'NOCERT' => \SimpleSAML\Locale\Translate::noop('{errors:title_NOCERT}'),
39  'NORELAYSTATE' => \SimpleSAML\Locale\Translate::noop('{errors:title_NORELAYSTATE}'),
40  'NOSTATE' => \SimpleSAML\Locale\Translate::noop('{errors:title_NOSTATE}'),
41  'NOTFOUND' => \SimpleSAML\Locale\Translate::noop('{errors:title_NOTFOUND}'),
42  'NOTFOUNDREASON' => \SimpleSAML\Locale\Translate::noop('{errors:title_NOTFOUNDREASON}'),
43  'NOTSET' => \SimpleSAML\Locale\Translate::noop('{errors:title_NOTSET}'),
44  'NOTVALIDCERT' => \SimpleSAML\Locale\Translate::noop('{errors:title_NOTVALIDCERT}'),
45  'PROCESSASSERTION' => \SimpleSAML\Locale\Translate::noop('{errors:title_PROCESSASSERTION}'),
46  'PROCESSAUTHNREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:title_PROCESSAUTHNREQUEST}'),
47  'RESPONSESTATUSNOSUCCESS' => \SimpleSAML\Locale\Translate::noop('{errors:title_RESPONSESTATUSNOSUCCESS}'),
48  'SLOSERVICEPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:title_SLOSERVICEPARAMS}'),
49  'SSOPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:title_SSOPARAMS}'),
50  'UNHANDLEDEXCEPTION' => \SimpleSAML\Locale\Translate::noop('{errors:title_UNHANDLEDEXCEPTION}'),
51  'UNKNOWNCERT' => \SimpleSAML\Locale\Translate::noop('{errors:title_UNKNOWNCERT}'),
52  'USERABORTED' => \SimpleSAML\Locale\Translate::noop('{errors:title_USERABORTED}'),
53  'WRONGUSERPASS' => \SimpleSAML\Locale\Translate::noop('{errors:title_WRONGUSERPASS}'),
54  );
55  }
56 
57 
65  public static function getAllErrorCodeTitles()
66  {
67  return self::defaultGetAllErrorCodeTitles();
68  }
69 
70 
76  final public static function defaultGetAllErrorCodeDescriptions()
77  {
78  return array(
79  'ACSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_ACSPARAMS}'),
80  'ARSPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_ARSPARAMS}'),
81  'AUTHSOURCEERROR' => \SimpleSAML\Locale\Translate::noop('{errors:descr_AUTHSOURCEERROR}'),
82  'BADREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:descr_BADREQUEST}'),
83  'CASERROR' => \SimpleSAML\Locale\Translate::noop('{errors:descr_CASERROR}'),
84  'CONFIG' => \SimpleSAML\Locale\Translate::noop('{errors:descr_CONFIG}'),
85  'CREATEREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:descr_CREATEREQUEST}'),
86  'DISCOPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_DISCOPARAMS}'),
87  'GENERATEAUTHNRESPONSE' => \SimpleSAML\Locale\Translate::noop('{errors:descr_GENERATEAUTHNRESPONSE}'),
88  'INVALIDCERT' => \SimpleSAML\Locale\Translate::noop('{errors:descr_INVALIDCERT}'),
89  'LDAPERROR' => \SimpleSAML\Locale\Translate::noop('{errors:descr_LDAPERROR}'),
90  'LOGOUTINFOLOST' => \SimpleSAML\Locale\Translate::noop('{errors:descr_LOGOUTINFOLOST}'),
91  'LOGOUTREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:descr_LOGOUTREQUEST}'),
92  'MEMCACHEDOWN' => \SimpleSAML\Locale\Translate::noop('{errors:descr_MEMCACHEDOWN}'),
93  'METADATA' => \SimpleSAML\Locale\Translate::noop('{errors:descr_METADATA}'),
94  'METADATANOTFOUND' => \SimpleSAML\Locale\Translate::noop('{errors:descr_METADATANOTFOUND}'),
95  'NOACCESS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NOACCESS}'),
96  'NOCERT' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NOCERT}'),
97  'NORELAYSTATE' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NORELAYSTATE}'),
98  'NOSTATE' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NOSTATE}'),
99  'NOTFOUND' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NOTFOUND}'),
100  'NOTFOUNDREASON' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NOTFOUNDREASON}'),
101  'NOTSET' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NOTSET}'),
102  'NOTVALIDCERT' => \SimpleSAML\Locale\Translate::noop('{errors:descr_NOTVALIDCERT}'),
103  'PROCESSASSERTION' => \SimpleSAML\Locale\Translate::noop('{errors:descr_PROCESSASSERTION}'),
104  'PROCESSAUTHNREQUEST' => \SimpleSAML\Locale\Translate::noop('{errors:descr_PROCESSAUTHNREQUEST}'),
105  'RESPONSESTATUSNOSUCCESS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_RESPONSESTATUSNOSUCCESS}'),
106  'SLOSERVICEPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_SLOSERVICEPARAMS}'),
107  'SSOPARAMS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_SSOPARAMS}'),
108  'UNHANDLEDEXCEPTION' => \SimpleSAML\Locale\Translate::noop('{errors:descr_UNHANDLEDEXCEPTION}'),
109  'UNKNOWNCERT' => \SimpleSAML\Locale\Translate::noop('{errors:descr_UNKNOWNCERT}'),
110  'USERABORTED' => \SimpleSAML\Locale\Translate::noop('{errors:descr_USERABORTED}'),
111  'WRONGUSERPASS' => \SimpleSAML\Locale\Translate::noop('{errors:descr_WRONGUSERPASS}'),
112  );
113  }
114 
122  public static function getAllErrorCodeDescriptions()
123  {
124  return self::defaultGetAllErrorCodeDescriptions();
125  }
126 
127 
135  public static function getAllErrorCodeMessages()
136  {
137  return array(
138  'title' => self::getAllErrorCodeTitles(),
139  'descr' => self::getAllErrorCodeDescriptions(),
140  );
141  }
142 
143 
151  public static function getErrorCodeTitle($errorCode)
152  {
153  $errorCodeTitles = self::getAllErrorCodeTitles();
154  return $errorCodeTitles[$errorCode];
155  }
156 
157 
165  public static function getErrorCodeDescription($errorCode)
166  {
167  $errorCodeDescriptions = self::getAllErrorCodeDescriptions();
168  return $errorCodeDescriptions[$errorCode];
169  }
170 
171 
181  public static function getErrorCodeMessage($errorCode)
182  {
183  return array(
184  'title' => self::getErrorCodeTitle($errorCode),
185  'descr' => self::getErrorCodeDescription($errorCode),
186  );
187  }
188 }
static getAllErrorCodeMessages()
Get a map of both errorcode titles and descriptions.
Definition: ErrorCodes.php:135
Attribute-related utility methods.
static getErrorCodeTitle($errorCode)
Fetch a translation string for a title for a given error code.
Definition: ErrorCodes.php:151
static defaultGetAllErrorCodeDescriptions()
Fetch all default translation strings for error code descriptions.
Definition: ErrorCodes.php:76
Create styles array
The data for the language used.
$errorCode
static getErrorCodeDescription($errorCode)
Fetch a translation string for a description for a given error code.
Definition: ErrorCodes.php:165
static defaultGetAllErrorCodeTitles()
Fetch all default translation strings for error code titles.
Definition: ErrorCodes.php:18
static getAllErrorCodeDescriptions()
Fetch all translation strings for error code descriptions.
Definition: ErrorCodes.php:122
static getErrorCodeMessage($errorCode)
Get both title and description for a specific error code.
Definition: ErrorCodes.php:181
static getAllErrorCodeTitles()
Fetch all translation strings for error code titles.
Definition: ErrorCodes.php:65