@@ -47,116 +47,116 @@ |
||
| 47 | 47 | * @deprecated 13.0.0 |
| 48 | 48 | */ |
| 49 | 49 | class User { |
| 50 | - /** |
|
| 51 | - * Get the user id of the user currently logged in. |
|
| 52 | - * @return string uid or false |
|
| 53 | - * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID() |
|
| 54 | - * @since 5.0.0 |
|
| 55 | - */ |
|
| 56 | - public static function getUser() { |
|
| 57 | - return \OC_User::getUser(); |
|
| 58 | - } |
|
| 50 | + /** |
|
| 51 | + * Get the user id of the user currently logged in. |
|
| 52 | + * @return string uid or false |
|
| 53 | + * @deprecated 8.0.0 Use \OC::$server->getUserSession()->getUser()->getUID() |
|
| 54 | + * @since 5.0.0 |
|
| 55 | + */ |
|
| 56 | + public static function getUser() { |
|
| 57 | + return \OC_User::getUser(); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Get a list of all users |
|
| 62 | - * @param string $search search pattern |
|
| 63 | - * @param int|null $limit |
|
| 64 | - * @param int|null $offset |
|
| 65 | - * @return array an array of all uids |
|
| 66 | - * @deprecated 8.1.0 use method search() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 67 | - * @since 5.0.0 |
|
| 68 | - */ |
|
| 69 | - public static function getUsers( $search = '', $limit = null, $offset = null ) { |
|
| 70 | - return \OC_User::getUsers( $search, $limit, $offset ); |
|
| 71 | - } |
|
| 60 | + /** |
|
| 61 | + * Get a list of all users |
|
| 62 | + * @param string $search search pattern |
|
| 63 | + * @param int|null $limit |
|
| 64 | + * @param int|null $offset |
|
| 65 | + * @return array an array of all uids |
|
| 66 | + * @deprecated 8.1.0 use method search() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 67 | + * @since 5.0.0 |
|
| 68 | + */ |
|
| 69 | + public static function getUsers( $search = '', $limit = null, $offset = null ) { |
|
| 70 | + return \OC_User::getUsers( $search, $limit, $offset ); |
|
| 71 | + } |
|
| 72 | 72 | |
| 73 | - /** |
|
| 74 | - * Get the user display name of the user currently logged in. |
|
| 75 | - * @param string|null $user user id or null for current user |
|
| 76 | - * @return string display name |
|
| 77 | - * @deprecated 8.1.0 fetch \OCP\IUser (has getDisplayName()) by using method |
|
| 78 | - * get() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 79 | - * @since 5.0.0 |
|
| 80 | - */ |
|
| 81 | - public static function getDisplayName( $user = null ) { |
|
| 82 | - return \OC_User::getDisplayName( $user ); |
|
| 83 | - } |
|
| 73 | + /** |
|
| 74 | + * Get the user display name of the user currently logged in. |
|
| 75 | + * @param string|null $user user id or null for current user |
|
| 76 | + * @return string display name |
|
| 77 | + * @deprecated 8.1.0 fetch \OCP\IUser (has getDisplayName()) by using method |
|
| 78 | + * get() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 79 | + * @since 5.0.0 |
|
| 80 | + */ |
|
| 81 | + public static function getDisplayName( $user = null ) { |
|
| 82 | + return \OC_User::getDisplayName( $user ); |
|
| 83 | + } |
|
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * Get a list of all display names and user ids. |
|
| 87 | - * @param string $search search pattern |
|
| 88 | - * @param int|null $limit |
|
| 89 | - * @param int|null $offset |
|
| 90 | - * @return array an array of all display names (value) and the correspondig uids (key) |
|
| 91 | - * @deprecated 8.1.0 use method searchDisplayName() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 92 | - * @since 5.0.0 |
|
| 93 | - * @suppress PhanDeprecatedFunction |
|
| 94 | - */ |
|
| 95 | - public static function getDisplayNames( $search = '', $limit = null, $offset = null ) { |
|
| 96 | - return \OC_User::getDisplayNames( $search, $limit, $offset ); |
|
| 97 | - } |
|
| 85 | + /** |
|
| 86 | + * Get a list of all display names and user ids. |
|
| 87 | + * @param string $search search pattern |
|
| 88 | + * @param int|null $limit |
|
| 89 | + * @param int|null $offset |
|
| 90 | + * @return array an array of all display names (value) and the correspondig uids (key) |
|
| 91 | + * @deprecated 8.1.0 use method searchDisplayName() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 92 | + * @since 5.0.0 |
|
| 93 | + * @suppress PhanDeprecatedFunction |
|
| 94 | + */ |
|
| 95 | + public static function getDisplayNames( $search = '', $limit = null, $offset = null ) { |
|
| 96 | + return \OC_User::getDisplayNames( $search, $limit, $offset ); |
|
| 97 | + } |
|
| 98 | 98 | |
| 99 | - /** |
|
| 100 | - * Check if the user is logged in |
|
| 101 | - * @return boolean |
|
| 102 | - * @since 5.0.0 |
|
| 103 | - * @deprecated 13.0.0 Use annotation based ACLs from the AppFramework instead |
|
| 104 | - */ |
|
| 105 | - public static function isLoggedIn() { |
|
| 106 | - return \OC::$server->getUserSession()->isLoggedIn(); |
|
| 107 | - } |
|
| 99 | + /** |
|
| 100 | + * Check if the user is logged in |
|
| 101 | + * @return boolean |
|
| 102 | + * @since 5.0.0 |
|
| 103 | + * @deprecated 13.0.0 Use annotation based ACLs from the AppFramework instead |
|
| 104 | + */ |
|
| 105 | + public static function isLoggedIn() { |
|
| 106 | + return \OC::$server->getUserSession()->isLoggedIn(); |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - /** |
|
| 110 | - * Check if a user exists |
|
| 111 | - * @param string $uid the username |
|
| 112 | - * @param string $excludingBackend (default none) |
|
| 113 | - * @return boolean |
|
| 114 | - * @deprecated 8.1.0 use method userExists() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 115 | - * @since 5.0.0 |
|
| 116 | - */ |
|
| 117 | - public static function userExists($uid, $excludingBackend = null) { |
|
| 118 | - return \OC_User::userExists($uid); |
|
| 119 | - } |
|
| 120 | - /** |
|
| 121 | - * Logs the user out including all the session data |
|
| 122 | - * Logout, destroys session |
|
| 123 | - * @deprecated 8.0.0 Use \OC::$server->getUserSession()->logout(); |
|
| 124 | - * @since 5.0.0 |
|
| 125 | - */ |
|
| 126 | - public static function logout() { |
|
| 127 | - \OC::$server->getUserSession()->logout(); |
|
| 128 | - } |
|
| 109 | + /** |
|
| 110 | + * Check if a user exists |
|
| 111 | + * @param string $uid the username |
|
| 112 | + * @param string $excludingBackend (default none) |
|
| 113 | + * @return boolean |
|
| 114 | + * @deprecated 8.1.0 use method userExists() of \OCP\IUserManager - \OC::$server->getUserManager() |
|
| 115 | + * @since 5.0.0 |
|
| 116 | + */ |
|
| 117 | + public static function userExists($uid, $excludingBackend = null) { |
|
| 118 | + return \OC_User::userExists($uid); |
|
| 119 | + } |
|
| 120 | + /** |
|
| 121 | + * Logs the user out including all the session data |
|
| 122 | + * Logout, destroys session |
|
| 123 | + * @deprecated 8.0.0 Use \OC::$server->getUserSession()->logout(); |
|
| 124 | + * @since 5.0.0 |
|
| 125 | + */ |
|
| 126 | + public static function logout() { |
|
| 127 | + \OC::$server->getUserSession()->logout(); |
|
| 128 | + } |
|
| 129 | 129 | |
| 130 | - /** |
|
| 131 | - * Check if the password is correct |
|
| 132 | - * @param string $uid The username |
|
| 133 | - * @param string $password The password |
|
| 134 | - * @return string|false username on success, false otherwise |
|
| 135 | - * |
|
| 136 | - * Check if the password is correct without logging in the user |
|
| 137 | - * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword(); |
|
| 138 | - * @since 5.0.0 |
|
| 139 | - */ |
|
| 140 | - public static function checkPassword( $uid, $password ) { |
|
| 141 | - return \OC_User::checkPassword( $uid, $password ); |
|
| 142 | - } |
|
| 130 | + /** |
|
| 131 | + * Check if the password is correct |
|
| 132 | + * @param string $uid The username |
|
| 133 | + * @param string $password The password |
|
| 134 | + * @return string|false username on success, false otherwise |
|
| 135 | + * |
|
| 136 | + * Check if the password is correct without logging in the user |
|
| 137 | + * @deprecated 8.0.0 Use \OC::$server->getUserManager()->checkPassword(); |
|
| 138 | + * @since 5.0.0 |
|
| 139 | + */ |
|
| 140 | + public static function checkPassword( $uid, $password ) { |
|
| 141 | + return \OC_User::checkPassword( $uid, $password ); |
|
| 142 | + } |
|
| 143 | 143 | |
| 144 | - /** |
|
| 145 | - * Check if the user is a admin, redirects to home if not |
|
| 146 | - * @since 5.0.0 |
|
| 147 | - * @deprecated 13.0.0 Use annotation based ACLs from the AppFramework instead |
|
| 148 | - */ |
|
| 149 | - public static function checkAdminUser() { |
|
| 150 | - \OC_Util::checkAdminUser(); |
|
| 151 | - } |
|
| 144 | + /** |
|
| 145 | + * Check if the user is a admin, redirects to home if not |
|
| 146 | + * @since 5.0.0 |
|
| 147 | + * @deprecated 13.0.0 Use annotation based ACLs from the AppFramework instead |
|
| 148 | + */ |
|
| 149 | + public static function checkAdminUser() { |
|
| 150 | + \OC_Util::checkAdminUser(); |
|
| 151 | + } |
|
| 152 | 152 | |
| 153 | - /** |
|
| 154 | - * Check if the user is logged in, redirects to home if not. With |
|
| 155 | - * redirect URL parameter to the request URI. |
|
| 156 | - * @since 5.0.0 |
|
| 157 | - * @deprecated 13.0.0 Use annotation based ACLs from the AppFramework instead |
|
| 158 | - */ |
|
| 159 | - public static function checkLoggedIn() { |
|
| 160 | - \OC_Util::checkLoggedIn(); |
|
| 161 | - } |
|
| 153 | + /** |
|
| 154 | + * Check if the user is logged in, redirects to home if not. With |
|
| 155 | + * redirect URL parameter to the request URI. |
|
| 156 | + * @since 5.0.0 |
|
| 157 | + * @deprecated 13.0.0 Use annotation based ACLs from the AppFramework instead |
|
| 158 | + */ |
|
| 159 | + public static function checkLoggedIn() { |
|
| 160 | + \OC_Util::checkLoggedIn(); |
|
| 161 | + } |
|
| 162 | 162 | } |