Cosmetics changes : remove ending lines spaces

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3012 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-08-31 07:20:24 +00:00
parent 94099866f6
commit a04d3a4f4a
35 changed files with 208 additions and 210 deletions

View File

@@ -1,5 +1,5 @@
<?php
/** The abstraction class of the users
/** The abstraction class of the users
Allow to manage the users in multiple storages (SQL, HTPasswd, passwd file).
CRUD the users and allow to modify the password */
class users
@@ -9,7 +9,7 @@ class users
{
}
/** Initialise the storage
/** Initialise the storage
Create the structure of data needed to the class */
public function initStorage ()
{
@@ -20,7 +20,7 @@ class users
password) */
public function adduser ($email, $firstname, $lastname, $password=null)
{
}
}
/** Delete a user */
public function deluser ($email)
@@ -37,7 +37,7 @@ class users
{
}
/** Change password
/** Change password
@param string $email the user email to change the password
@param string $oldpassword The old password (to check if the user have the
rights to change the password)
@@ -65,15 +65,15 @@ class users
public function checkEmail ($email)
{
if (! is_string ($email))
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid email provided : not a string"),
500);
if (strlen ($email) < 5)
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid email provided : too short"),
500);
if (strpos ($email, ":") !== false)
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid email provided : colon forbidden"),
500);
return true;
@@ -83,15 +83,15 @@ class users
public function checkFirstname ($firstname)
{
if (! is_string ($firstname))
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid firstname provided : not a string"),
500);
if (strlen ($firstname) < 1)
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid firstname provided : too short"),
500);
if (strpos ($firstname, ":") !== false)
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid firstname provided : colon forbidden"),
500);
return true;
@@ -101,11 +101,11 @@ class users
public function checkLastname ($lastname)
{
if (! is_string ($lastname))
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid lastname provided : not a string"),
500);
if (strpos ($lastname, ":") !== false)
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid lastname provided : colon forbidden"),
500);
return true;
@@ -115,15 +115,15 @@ class users
public function checkPassword ($password)
{
if (! is_string ($password))
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid password provided : not a string"),
500);
if (strlen ($password) < 5)
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid password provided : too short"),
500);
if (strlen ($password) >= 128)
throw new Exception (dgettext("domframework",
throw new Exception (dgettext("domframework",
"Invalid password provided : too long"),
500);
return true;