ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilWACException.php
Go to the documentation of this file.
1 <?php
18 require_once('./Services/Exceptions/classes/class.ilException.php');
19 
27 {
28  public const CODE_NO_TYPE = 9001;
29  public const CODE_NO_PATH = 9002;
30  public const ACCESS_WITHOUT_CHECK = 9003;
31  public const NO_CHECKING_INSTANCE = 9004;
32  public const WRONG_PATH_TYPE = 9005;
33  public const INITIALISATION_FAILED = 9006;
34  public const DATA_DIR_NON_WRITEABLE = 9007;
35  public const ACCESS_DENIED = 9010;
36  public const ACCESS_DENIED_NO_PUB = 9011;
37  public const ACCESS_DENIED_NO_LOGIN = 9012;
38  public const MAX_LIFETIME = 9013;
39  public const NOT_FOUND = 9014;
43  protected static $messages = [
44  self::CODE_NO_TYPE => 'No type for Path-Signing selected',
45  self::WRONG_PATH_TYPE => 'This path-type cannot be signed',
46  self::CODE_NO_PATH => 'No path for checking available',
47  self::ACCESS_WITHOUT_CHECK => 'Resource could not be found',
48  self::NO_CHECKING_INSTANCE => 'This path is not secured by a class',
49  self::ACCESS_DENIED => 'Resource could not be found',
50  self::ACCESS_DENIED_NO_PUB => 'Resource could not be found',
51  self::INITIALISATION_FAILED => 'An error occured during your request. Please reload the page.',
52  self::DATA_DIR_NON_WRITEABLE => 'The SALT cannot be written to your /data directory. Please check the write permissions on the webserver.',
53  self::MAX_LIFETIME => 'You can only only use lifetimes shorter than ilWACSignedPath::MAX_LIFETIME',
54  self::ACCESS_DENIED_NO_LOGIN => 'No Login found',
55  self::NOT_FOUND => 'Resource not Found'
56  ];
57 
58 
63  public function __construct($code, $additional_message = '', Throwable $previous = null)
64  {
65  $message = self::$messages[$code];
66 
67  if ($this->isNonEmptyString($additional_message)) {
68  $message = "\"{$this->message}\" with additional message: \"$additional_message\"";
69  }
70  parent::__construct($message, $code, $previous);
71  }
72 
73 
81  private function isNonEmptyString($text)
82  {
83  assert(is_string($text));
84 
85  return strcmp($text, '') !== 0;
86  }
87 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct($code, $additional_message='', Throwable $previous=null)
$messages
Definition: xapiexit.php:5
isNonEmptyString($text)
Checks if the given text is empty or not.
__construct(Container $dic, ilPlugin $plugin)
$message
Definition: xapiexit.php:14