Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

provider_interface.php

Zuletzt modifiziert: 09.10.2024, 12:54 - Dateigröße: 6.38 KiB


001  <?php
002  /**
003  *
004  * This file is part of the phpBB Forum Software package.
005  *
006  * @copyright (c) phpBB Limited <https://www.phpbb.com>
007  * @license GNU General Public License, version 2 (GPL-2.0)
008  *
009  * For full copyright and license information, please see
010  * the docs/CREDITS.txt file.
011  *
012  */
013   
014  namespace phpbb\auth\provider;
015   
016  /**
017  * The interface authentication provider classes have to implement.
018  */
019  interface provider_interface
020  {
021      /**
022       * Checks whether the user is currently identified to the authentication
023       * provider.
024       * Called in acp_board while setting authentication plugins.
025       * Changing to an authentication provider will not be permitted in acp_board
026       * if there is an error.
027       *
028       * @return     boolean|string     False if the user is identified, otherwise an
029       *                            error message, or null if not implemented.
030       */
031      public function init();
032   
033      /**
034       * Performs login.
035       *
036       * @param    string    $username     The name of the user being authenticated.
037       * @param    string    $password    The password of the user.
038       * @return    array    An associative array of the format:
039       *                        array(
040       *                            'status' => status constant
041       *                            'error_msg' => string
042       *                            'user_row' => array
043       *                        )
044       *                    A fourth key of the array may be present:
045       *                    'redirect_data'    This key is only used when 'status' is
046       *                    equal to LOGIN_SUCCESS_LINK_PROFILE and its value is an
047       *                    associative array that is turned into GET variables on
048       *                    the redirect url.
049       */
050      public function login($username, $password);
051   
052      /**
053       * Autologin function
054       *
055       * @return     array|null    containing the user row, empty if no auto login
056       *                         should take place, or null if not impletmented.
057       */
058      public function autologin();
059   
060      /**
061       * This function is used to output any required fields in the authentication
062       * admin panel. It also defines any required configuration table fields.
063       *
064       * @return    array|null    Returns null if not implemented or an array of the
065       *                        configuration fields of the provider.
066       */
067      public function acp();
068   
069      /**
070       * This function updates the template with variables related to the acp
071       * options with whatever configuraton values are passed to it as an array.
072       * It then returns the name of the acp file related to this authentication
073       * provider.
074       * @param    array    $new_config Contains the new configuration values that
075       *                                have been set in acp_board.
076       * @return    array|null        Returns null if not implemented or an array with
077       *                            the template file name and an array of the vars
078       *                            that the template needs that must conform to the
079       *                            following example:
080       *                            array(
081       *                                'TEMPLATE_FILE'    => string,
082       *                                'TEMPLATE_VARS'    => array(...),
083       *                            )
084       *                            An optional third element may be added to this
085       *                            array: 'BLOCK_VAR_NAME'. If this is present,
086       *                            then its value should be a string that is used
087       *                            to designate the name of the loop used in the
088       *                            ACP template file. When this is present, an
089       *                            additional key named 'BLOCK_VARS' is required.
090       *                            This must be an array containing at least one
091       *                            array of variables that will be assigned during
092       *                            the loop in the template. An example of this is
093       *                            presented below:
094       *                            array(
095       *                                'BLOCK_VAR_NAME'    => string,
096       *                                'BLOCK_VARS'        => array(
097       *                                    'KEY IS UNIMPORTANT' => array(...),
098       *                                ),
099       *                                'TEMPLATE_FILE'    => string,
100       *                                'TEMPLATE_VARS'    => array(...),
101       *                            )
102       */
103      public function get_acp_template($new_config);
104   
105      /**
106      * Returns an array of data necessary to build custom elements on the login
107      * form.
108      *
109      * @return    array|null    If this function is not implemented on an auth
110      *                        provider then it returns null. If it is implemented
111      *                        it will return an array of up to four elements of
112      *                        which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is
113      *                        present then 'BLOCK_VARS' must also be present in
114      *                        the array. The fourth element 'VARS' is also
115      *                        optional. The array, with all four elements present
116      *                        looks like the following:
117      *                        array(
118      *                            'TEMPLATE_FILE'        => string,
119      *                            'BLOCK_VAR_NAME'    => string,
120      *                            'BLOCK_VARS'        => array(...),
121      *                            'VARS'                => array(...),
122      *                        )
123      */
124      public function get_login_data();
125   
126      /**
127       * Performs additional actions during logout.
128       *
129       * @param     array    $data            An array corresponding to
130       *                                    \phpbb\session::data
131       * @param     boolean    $new_session    True for a new session, false for no new
132       *                                    session.
133       */
134      public function logout($data, $new_session);
135   
136      /**
137       * The session validation function checks whether the user is still logged
138       * into phpBB.
139       *
140       * @param     array     $user
141       * @return     boolean    true if the given user is authenticated, false if the
142       *                     session should be closed, or null if not implemented.
143       */
144      public function validate_session($user);
145   
146      /**
147      * Checks to see if $login_link_data contains all information except for the
148      * user_id of an account needed to successfully link an external account to
149      * a forum account.
150      *
151      * @param    array    $login_link_data    Any data needed to link a phpBB account to
152      *                                an external account.
153      * @return    string|null    Returns a string with a language constant if there
154      *                        is data missing or null if there is no error.
155      */
156      public function login_link_has_necessary_data($login_link_data);
157   
158      /**
159      * Links an external account to a phpBB account.
160      *
161      * @param    array    $link_data    Any data needed to link a phpBB account to
162      *                                an external account.
163      */
164      public function link_account(array $link_data);
165   
166      /**
167      * Returns an array of data necessary to build the ucp_auth_link page
168      *
169      * @return    array|null    If this function is not implemented on an auth
170      *                        provider then it returns null. If it is implemented
171      *                        it will return an array of up to four elements of
172      *                        which only 'TEMPLATE_FILE'. If 'BLOCK_VAR_NAME' is
173      *                        present then 'BLOCK_VARS' must also be present in
174      *                        the array. The fourth element 'VARS' is also
175      *                        optional. The array, with all four elements present
176      *                        looks like the following:
177      *                        array(
178      *                            'TEMPLATE_FILE'        => string,
179      *                            'BLOCK_VAR_NAME'    => string,
180      *                            'BLOCK_VARS'        => array(...),
181      *                            'VARS'                => array(...),
182      *                        )
183      */
184      public function get_auth_link_data();
185   
186      /**
187      * Unlinks an external account from a phpBB account.
188      *
189      * @param    array    $link_data    Any data needed to unlink a phpBB account
190      *                                from a phpbb account.
191      */
192      public function unlink_account(array $link_data);
193  }
194