Skip to content

Commit 9b7361e

Browse files
committed
Replace sppmod_* with namespaced version
1 parent 0aeec2a commit 9b7361e

192 files changed

Lines changed: 1261 additions & 981 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

config-templates/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@
563563
* See docs/simplesamlphp-advancedfeatures.txt for function code example.
564564
*
565565
* Example:
566-
* 'session.check_function' => array('sspmod_example_Util', 'checkSession'),
566+
* 'session.check_function' => array('\SimpleSAML\Module\example\Util', 'checkSession'),
567567
*/
568568

569569

@@ -740,7 +740,7 @@
740740
* the default language for the user.
741741
*
742742
* Example:
743-
* 'language.get_language_function' => array('sspmod_example_Template', 'getLanguage'),
743+
* 'language.get_language_function' => array('\SimpleSAML\Module\example\Template', 'getLanguage'),
744744
*/
745745

746746
/*

docs/simplesamlphp-authproc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The configuration of *Auth Proc Filters* is a list of filters with priority as *
6161

6262
This configuration will execute *Auth Proc Filters* one by one, with the priority value in increasing order. When *Auth Proc Filters* is configured in multiple places, in example both globally, in the hosted IdP and remote SP metadata, then the list is interleaved sorted by priority.
6363

64-
The most important parameter of each item on the list is the *class* of the *Auth Proc Filter*. The syntax of the class is `modulename:classname`. As an example the class definition `core:AttributeLimit` will be expanded to look for the class `sspmod_core_Auth_Process_AttributeLimit`. The location of this class file *must* then be: `modules/core/lib/Auth/Process/AttributeLimit.php`.
64+
The most important parameter of each item on the list is the *class* of the *Auth Proc Filter*. The syntax of the class is `modulename:classname`. As an example the class definition `core:AttributeLimit` will be expanded to look for the class `\SimpleSAML\Module\core\Auth\Process\AttributeLimit`. The location of this class file *must* then be: `modules/core/lib/Auth/Process/AttributeLimit.php`.
6565

6666
You will see that a bunch of useful filters is included in the `core` module. In addition the `consent` module that is included in the SimpleSAMLphp distribution implements a filter. Beyond that, you are encouraged to create your own filters and share with the community. If you have created a cool *Auth Proc Filter* that does something useful, let us know, and we may share it on the [SimpleSAMLphp web site][].
6767

docs/simplesamlphp-authsource.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Creating authentication sources
22
===============================
33

4-
All authentication sources are located in the `lib/Auth/Source/` directory in a module, and the class name is `sspmod_<module>_Auth_Source_<name>`.
4+
All authentication sources are located in the `lib/Auth/Source/` directory in a module, and the class name is `\SimpleSAML\Module\<module>\Auth\Source\<name>`.
55
The authentication source must extend the `\SimpleSAML\Auth\Source` class or one of its subclasses.
66

77
The "entry point" of an authentication source is the `authenticate()`-function.
@@ -36,7 +36,7 @@ Username/password authentication
3636
--------------------------------
3737

3838
Since username/password authentication is quite a common operation, a base class has been created for this.
39-
This is the `sspmod_core_Auth_UserPassBase` class, which is can be found as `modules/core/lib/Auth/UserPassBase.php`.
39+
This is the `\SimpleSAML\Module\core\Auth\UserPassBase` class, which is can be found as `modules/core/lib/Auth/UserPassBase.php`.
4040

4141
The only function you need to implement is the `login($username, $password)`-function.
4242
This function receives the username and password the user entered, and is expected to return the attributes of that user.

docs/simplesamlphp-customauth.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To begin with, we will create a very simple authentication source, where the use
4040
Create the file `modules/mymodule/lib/Auth/Source/MyAuth.php` with the following contents:
4141

4242
<?php
43-
class sspmod_mymodule_Auth_Source_MyAuth extends sspmod_core_Auth_UserPassBase {
43+
class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase {
4444
protected function login($username, $password) {
4545
if ($username !== 'theusername' || $password !== 'thepassword') {
4646
throw new \SimpleSAML\Error\Error('WRONGUSERPASS');
@@ -55,10 +55,10 @@ Create the file `modules/mymodule/lib/Auth/Source/MyAuth.php` with the following
5555

5656
Some things to note:
5757

58-
- The classname is `sspmod_mymodule_Auth_Source_MyAuth`.
58+
- The classname is `\SimpleSAML\Module\mymodule\Auth\Source\MyAuth`.
5959
This tells SimpleSAMLphp to look for the class in `modules/mymodule/lib/Auth/Source/MyAuth.php`.
6060

61-
- Our authentication source subclassese `sspmod_core_Auth_UserPassBase`.
61+
- Our authentication source subclassese `\SimpleSAML\Module\core\Auth\UserPassBase`.
6262
This is a helper-class that implements much of the common code needed for username/password authentication.
6363

6464
- The `login` function receives the username and password the user enters.
@@ -97,7 +97,7 @@ You can add it to the beginning of the list, so that the file looks something li
9797
The instance name is used to refer to this authentication source in other configuration files.
9898

9999
The first element of the configuration of the authentication source must be `'mymodule:MyAuth'`.
100-
This tells SimpleSAMLphp to look for the `sspmod_mymodule_Auth_Source_MyAuth` class.
100+
This tells SimpleSAMLphp to look for the `\SimpleSAML\Module\mymodule\Auth\Source\MyAuth` class.
101101

102102

103103
Testing our authentication source
@@ -168,7 +168,7 @@ We can then use the properties in the `login` function.
168168
The complete class file should look like this:
169169

170170
<?php
171-
class sspmod_mymodule_Auth_Source_MyAuth extends sspmod_core_Auth_UserPassBase {
171+
class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase {
172172

173173
private $username;
174174
private $password;
@@ -245,7 +245,7 @@ A SSHA password is created like this:
245245
The class follows:
246246

247247
<?php
248-
class sspmod_mymodule_Auth_Source_MyAuth extends sspmod_core_Auth_UserPassBase {
248+
class MyAuth extends \SimpleSAML\Module\core\Auth\UserPassBase {
249249

250250
/* The database DSN.
251251
* See the documentation for the various database drivers for information about the syntax:

docs/simplesamlphp-errorhandling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ For example, the `\SimpleSAML\Error\NoPassive` exception should be converted to
6767
* The second-level status code should be `urn:oasis:names:tc:SAML:2.0:status:NoPassive`.
6868
* The status message should contain the cause of the exception.
6969

70-
The `sspmod_saml_Error` class represents SAML 2 errors.
70+
The `\SimpleSAML\Module\saml\Error` class represents SAML 2 errors.
7171
It represents a SAML 2 status code with three elements: the top-level status code, the second-level status code and the status message.
7272
The second-level status code and the status message is optional, and can be `NULL`.
7373

74-
The `sspmod_saml_Error` class contains a helper function named `fromException`.
74+
The `\SimpleSAML\Module\saml\Error` class contains a helper function named `fromException`.
7575
The `fromException()` function is used by `www/saml2/idp/SSOService.php` to return SAML 2 errors to the SP.
7676
The function contains a list which maps various exceptions to specific SAML 2 errors.
7777
If it is unable to convert the exception, it will return a generic SAML 2 error describing the original exception in its status message.
@@ -93,7 +93,7 @@ Converting SAML 2 errors to normal exceptions
9393
---------------------------------------------
9494

9595
On the SP side, we want to convert SAML 2 errors to SimpleSAMLphp exceptions again.
96-
This is handled by the `toException()` method in `sspmod_saml_Error`.
96+
This is handled by the `toException()` method in `\SimpleSAML\Module\saml\Error`.
9797
The assertion consumer script of the SAML 2 authentication source (`modules/saml2/sp/acs.php`) uses this method.
9898
The result is that generic exceptions are thrown from that authentication source.
9999

docs/simplesamlphp-modules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ hooks
7777
lib
7878
: This directory contains classes which belong to this module.
7979
All classes must be named in the following pattern:
80-
`sspmod_<module name>_<class name>` When looking up the filename of
80+
`\SimpleSAML\Module\<module name>\<class name>` When looking up the filename of
8181
a class, SimpleSAMLphp will search for `<class name>` in the `lib`
8282
directory. Underscores in the class name will be translated into
8383
slashes.
8484

8585
: Thus, if SimpleSAMLphp needs to load a class named
86-
`sspmod_example_Auth_Source_Example`, it will load the file named
86+
`\SimpleSAML\Module\example\Auth\Source\Example`, it will load the file named
8787
`modules/example/lib/Auth/Source/Example.php`.
8888

8989
templates

lib/SimpleSAML/Auth/Default.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ public static function logoutCallback($state)
113113

114114
/**
115115
* @deprecated This method will be removed in SSP 2.0. Please use
116-
* sspmod_saml_Auth_Source_SP::handleUnsolicitedAuth() instead.
116+
* \SimpleSAML\Module\saml\Auth\Source\SP::handleUnsolicitedAuth() instead.
117117
*/
118118
public static function handleUnsolicitedAuth($authId, array $state, $redirectTo)
119119
{
120-
\sspmod_saml_Auth_Source_SP::handleUnsolicitedAuth($authId, $state, $redirectTo);
120+
\SimpleSAML\Module\saml\Auth\Source\SP::handleUnsolicitedAuth($authId, $state, $redirectTo);
121121
}
122122

123123

lib/SimpleSAML/Error/CriticalConfigurationError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function __construct($reason = null, $file = null, $config = null)
6464
*
6565
* @return CriticalConfigurationError
6666
*/
67-
public static function fromException(Exception $exception)
67+
public static function fromException(\Exception $exception)
6868
{
6969
$reason = null;
7070
$file = null;

lib/SimpleSAML/Logger/FileLoggingHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function log($level, $string)
107107
}
108108

109109
$string = str_replace($formats, $replacements, $string);
110-
file_put_contents($this->logFile, $string.PHP_EOL, FILE_APPEND);
110+
file_put_contents($this->logFile, $string.\PHP_EOL, FILE_APPEND);
111111
}
112112
}
113113
}

lib/SimpleSAML/Metadata/SAMLBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function addSecurityTokenServiceType($metadata)
122122

123123
$metadata = \SimpleSAML\Configuration::loadFromArray($metadata, $metadata['entityid']);
124124
$defaultEndpoint = $metadata->getDefaultEndpoint('SingleSignOnService');
125-
$e = new \sspmod_adfs_SAML2_XML_fed_SecurityTokenServiceType();
125+
$e = new \SimpleSAML\Module\adfs\SAML2\XML\fed\SecurityTokenServiceType();
126126
$e->Location = $defaultEndpoint['Location'];
127127

128128
$this->addCertificate($e, $metadata);

0 commit comments

Comments
 (0)