"Fossies" - the Fresh Open Source Software Archive

Member "nextcloud/lib/public/User/Backend/ABackend.php" (15 Jul 2020, 2101 Bytes) of package /linux/www/nextcloud-19.0.1.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ABackend.php" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 18.0.4_vs_19.0.0.

    1 <?php
    2 
    3 declare(strict_types=1);
    4 
    5 /**
    6  * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
    7  *
    8  * @author Christoph Wurst <christoph@winzerhof-wurst.at>
    9  * @author Roeland Jago Douma <roeland@famdouma.nl>
   10  *
   11  * @license GNU AGPL version 3 or any later version
   12  *
   13  * This program is free software: you can redistribute it and/or modify
   14  * it under the terms of the GNU Affero General Public License as
   15  * published by the Free Software Foundation, either version 3 of the
   16  * License, or (at your option) any later version.
   17  *
   18  * This program is distributed in the hope that it will be useful,
   19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   21  * GNU Affero General Public License for more details.
   22  *
   23  * You should have received a copy of the GNU Affero General Public License
   24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
   25  *
   26  */
   27 
   28 namespace OCP\User\Backend;
   29 
   30 use OC\User\Backend;
   31 use OCP\IUserBackend;
   32 use OCP\UserInterface;
   33 
   34 /**
   35  * @since 14.0.0
   36  */
   37 abstract class ABackend implements IUserBackend, UserInterface {
   38 
   39     /**
   40      * @deprecated 14.0.0
   41      *
   42      * @param int $actions The action to check for
   43      * @return bool
   44      */
   45     public function implementsActions($actions): bool {
   46         $implements = 0;
   47 
   48         if ($this instanceof ICreateUserBackend) {
   49             $implements |= Backend::CREATE_USER;
   50         }
   51         if ($this instanceof ISetPasswordBackend) {
   52             $implements |= Backend::SET_PASSWORD;
   53         }
   54         if ($this instanceof ICheckPasswordBackend) {
   55             $implements |= Backend::CHECK_PASSWORD;
   56         }
   57         if ($this instanceof IGetHomeBackend) {
   58             $implements |= Backend::GET_HOME;
   59         }
   60         if ($this instanceof IGetDisplayNameBackend) {
   61             $implements |= Backend::GET_DISPLAYNAME;
   62         }
   63         if ($this instanceof ISetDisplayNameBackend) {
   64             $implements |= Backend::SET_DISPLAYNAME;
   65         }
   66         if ($this instanceof IProvideAvatarBackend) {
   67             $implements |= Backend::PROVIDE_AVATAR;
   68         }
   69         if ($this instanceof ICountUsersBackend) {
   70             $implements |= Backend::COUNT_USERS;
   71         }
   72 
   73         return (bool)($actions & $implements);
   74     }
   75 }