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:
26
auth.php
26
auth.php
@@ -28,7 +28,7 @@ class auth
|
||||
$res .= "body { padding-top: 40px; padding-bottom: 40px;
|
||||
font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;
|
||||
background-attachment: fixed; background-position: top;
|
||||
background-image: radial-gradient(ellipse at center -60px,
|
||||
background-image: radial-gradient(ellipse at center -60px,
|
||||
#9da1ac 0%,#1c202a 100%);
|
||||
background-color: #eee; }\n";
|
||||
$res .= ".form-signin { max-width: 430px;padding:15px;margin:0 auto;}\n";
|
||||
@@ -87,25 +87,25 @@ class auth
|
||||
$res .= "'>\n";
|
||||
if ($alreadyAuth === false)
|
||||
{
|
||||
$res .= " <h2 class='form-signin-heading'>".dgettext("domframework",
|
||||
$res .= " <h2 class='form-signin-heading'>".dgettext("domframework",
|
||||
"Please sign in");
|
||||
$res .= "</h2>\n";
|
||||
$res .= " <input type='text' class='form-control' name='email' ";
|
||||
$res .= "placeholder='".dgettext("domframework",
|
||||
$res .= "placeholder='".dgettext("domframework",
|
||||
"Email address")."' required autofocus/>\n";
|
||||
$res .= " <input type='password' class='form-control' name='password' ";
|
||||
$res .= "placeholder='".dgettext("domframework",
|
||||
$res .= "placeholder='".dgettext("domframework",
|
||||
"Password")."' required/>\n";
|
||||
// $res .= " <label class='checkbox'>";
|
||||
// $res .= "<input type='checkbox' name='remember-me'/>".dgettext("domframework",
|
||||
// $res .= "<input type='checkbox' name='remember-me'/>".dgettext("domframework",
|
||||
// "Remember me");
|
||||
// $res .= "</label>\n";
|
||||
$res .= " <input type='submit' value='".dgettext("domframework",
|
||||
$res .= " <input type='submit' value='".dgettext("domframework",
|
||||
"Sign in")."'/>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$res .= " <h2 class='form-signin-heading'>".dgettext("domframework",
|
||||
$res .= " <h2 class='form-signin-heading'>".dgettext("domframework",
|
||||
"Already sign in");
|
||||
$res .= "</h2>\n";
|
||||
if (is_string ($alreadyAuth))
|
||||
@@ -129,7 +129,7 @@ class auth
|
||||
/** Establish the connection to authentication server */
|
||||
public function connect ()
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"No connect to authentication available"),
|
||||
405);
|
||||
}
|
||||
@@ -141,14 +141,14 @@ class auth
|
||||
@param string $password Password to authenticate */
|
||||
public function authentication ($email, $password)
|
||||
{
|
||||
throw new exception (dgettext("domframework",
|
||||
throw new exception (dgettext("domframework",
|
||||
"No authentication available"), 405);
|
||||
}
|
||||
|
||||
/** Return all the parameters recorded for the authenticate user */
|
||||
public function getdetails ()
|
||||
{
|
||||
throw new exception (dgettext("domframework",
|
||||
throw new exception (dgettext("domframework",
|
||||
"No getdetails available"), 405);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ class auth
|
||||
@param string $newpassword The new password to be recorded */
|
||||
public function changepassword ($oldpassword, $newpassword)
|
||||
{
|
||||
throw new exception (dgettext("domframework",
|
||||
throw new exception (dgettext("domframework",
|
||||
"No password change available"), 405);
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class auth
|
||||
@param string $newpassword The new password to be recorded */
|
||||
public function overwritepassword ($email, $newpassword)
|
||||
{
|
||||
throw new exception (dgettext("domframework",
|
||||
throw new exception (dgettext("domframework",
|
||||
"No password overwrite available"), 405);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class auth
|
||||
Return firstname, lastname, mail, with mail is an array */
|
||||
public function listusers ()
|
||||
{
|
||||
throw new exception (dgettext("domframework",
|
||||
throw new exception (dgettext("domframework",
|
||||
"No List User available"), 405);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class authentication
|
||||
public $htmlMethods = array ("session");
|
||||
/** The authentication methods. Can be ldap, sympa...*/
|
||||
public $authMethods = array ();
|
||||
/** The authentication servers configuration
|
||||
/** The authentication servers configuration
|
||||
array ("authXXXX"=>array (
|
||||
array ("ldapserver"=>"ldaps://annuaire.grenoble.cnrs.fr",
|
||||
"ldapport"=>636,
|
||||
|
||||
@@ -25,7 +25,7 @@ class authimap extends auth
|
||||
throw new Exception ("IMAP support unavailable in PHP", 500);
|
||||
}
|
||||
|
||||
/** Establish the connection to IMAP server. Don't do anything as the
|
||||
/** Establish the connection to IMAP server. Don't do anything as the
|
||||
needed parameters are username and password */
|
||||
public function connect ()
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ class authldap extends auth
|
||||
@param string $newpassword The new password to be recorded */
|
||||
public function changepassword ($oldpassword, $newpassword)
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The password can't be change for LDAP users"), 405);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class authorizationdb extends authorization
|
||||
public function initialize ()
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
$tables = $this->db->listTables ();
|
||||
if (!in_array ($this->db->tableprefix.$this->db->table, $tables))
|
||||
@@ -63,16 +63,16 @@ class authorizationdb extends authorization
|
||||
public function validate ($object)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
try
|
||||
{
|
||||
@@ -87,7 +87,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"),
|
||||
$object),
|
||||
404);
|
||||
@@ -140,24 +140,24 @@ class authorizationdb extends authorization
|
||||
public function add ($object, $ownerid, $groupid, $modbits)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
// The modbits are stored in octal to be more readable
|
||||
$modbits = decoct ($modbits);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
if ($this->authiduser !== 0 && $this->authiduser !== $ownerid)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Can't create object not owned by myself"), 406);
|
||||
if ($this->authiduser !== 0 && !in_array ($groupid, $this->authgroups))
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Can't create object with not owned group"), 406);
|
||||
try
|
||||
{
|
||||
@@ -172,7 +172,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s already defined"), $object),
|
||||
400);
|
||||
|
||||
@@ -209,19 +209,19 @@ class authorizationdb extends authorization
|
||||
public function drop ($object)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
if ($object === "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The root can not be removed"), 406);
|
||||
try
|
||||
{
|
||||
@@ -236,7 +236,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"),
|
||||
$object), 400);
|
||||
|
||||
@@ -246,10 +246,10 @@ class authorizationdb extends authorization
|
||||
{
|
||||
$rc = $this->db->delete ($object);
|
||||
if ($rc > 1)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Removing more than one object"), 406);
|
||||
if ($rc == 0)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"No object removed"), 406);
|
||||
$rc = $this->db->delete ("$object$this->separator%");
|
||||
return TRUE;
|
||||
@@ -266,10 +266,10 @@ class authorizationdb extends authorization
|
||||
|
||||
$rc = $this->db->delete ($object);
|
||||
if ($rc > 1)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Removing more than one object"), 406);
|
||||
if ($rc == 0)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"No object removed"), 406);
|
||||
$rc = $this->db->delete ("$object$this->separator%");
|
||||
return TRUE;
|
||||
@@ -283,19 +283,19 @@ class authorizationdb extends authorization
|
||||
public function chown ($object, $ownerid)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
if ($this->authiduser !== 0)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The chown is reserved to root user"), 405);
|
||||
try
|
||||
{
|
||||
@@ -310,7 +310,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"), $object),
|
||||
400);
|
||||
$search = reset ($search);
|
||||
@@ -326,22 +326,22 @@ class authorizationdb extends authorization
|
||||
public function chgrp ($object, $groupid)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
if ($this->authiduser !== 0 && !in_array ($groupid, $this->authgroups))
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The user must be in the wanted group"), 405);
|
||||
if (!in_array ("WRITE", $this->validate ($object)))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"%s is write protected"), $object), 405);
|
||||
try
|
||||
{
|
||||
@@ -356,7 +356,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"), $object),
|
||||
400);
|
||||
$search = reset ($search);
|
||||
@@ -372,19 +372,19 @@ class authorizationdb extends authorization
|
||||
public function chmod ($object, $mod)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
if (!in_array ("WRITE", $this->validate ($object)))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"%s is write protected"), $object), 405);
|
||||
try
|
||||
{
|
||||
@@ -399,7 +399,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"), $object),
|
||||
400);
|
||||
$search = reset ($search);
|
||||
@@ -415,16 +415,16 @@ class authorizationdb extends authorization
|
||||
public function lsmod ($object)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
try
|
||||
{
|
||||
@@ -439,7 +439,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"), $object),
|
||||
400);
|
||||
$search = reset ($search);
|
||||
@@ -453,16 +453,16 @@ class authorizationdb extends authorization
|
||||
public function lsown ($object)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
try
|
||||
{
|
||||
@@ -477,7 +477,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"), $object),
|
||||
400);
|
||||
$search = reset ($search);
|
||||
@@ -491,16 +491,16 @@ class authorizationdb extends authorization
|
||||
public function lsgrp ($object)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
if (substr ($object, -1) === "/")
|
||||
$object = substr ($object, 0, -1);
|
||||
if (substr ($object, 0, 1) !== "/")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Object don't start by slash"), 406);
|
||||
$object = preg_replace ("#//+#", "/", $object);
|
||||
if ($this->authiduser === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Not authenticated"), 401);
|
||||
try
|
||||
{
|
||||
@@ -515,7 +515,7 @@ class authorizationdb extends authorization
|
||||
// exists
|
||||
$search = $this->db->read (array (array ("object", $object)));
|
||||
if (count ($search) === 0)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Object %s doesn't exists"), $object),
|
||||
404);
|
||||
$search = reset ($search);
|
||||
@@ -531,7 +531,7 @@ class authorizationdb extends authorization
|
||||
private function treecheckExecute ($object)
|
||||
{
|
||||
if ($this->db === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Database to authorize is not connected"), 500);
|
||||
// Search all the parents in an array
|
||||
$parents = array ();
|
||||
@@ -568,7 +568,7 @@ class authorizationdb extends authorization
|
||||
}
|
||||
}
|
||||
if (!$found)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"The path %s is not found in database"),
|
||||
$p), 404);
|
||||
else
|
||||
@@ -593,7 +593,7 @@ class authorizationdb extends authorization
|
||||
if (($parentModbits & 0001) === 1)
|
||||
continue;
|
||||
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"No execute rights on %s"), $p), 405);
|
||||
}
|
||||
}
|
||||
@@ -624,7 +624,7 @@ class authorizationdb extends authorization
|
||||
if (($parentModbits & 0002) === 2)
|
||||
return TRUE;
|
||||
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"No write rights on %s"), $parent), 405);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class authparams
|
||||
public $password = null;
|
||||
|
||||
/** Parse the different authentication processes to found the email/password
|
||||
of the user.
|
||||
of the user.
|
||||
If non is found, return "anonymous", "anonymous" */
|
||||
public function __construct ($authprocesses=array("session","post"))
|
||||
{
|
||||
@@ -63,7 +63,7 @@ class authparams
|
||||
/** Get information from a HTTP authentication */
|
||||
public function http()
|
||||
{
|
||||
$realm = dgettext("domframework",
|
||||
$realm = dgettext("domframework",
|
||||
"Restricted access");
|
||||
if (!isset($_SERVER['PHP_AUTH_USER']))
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ class authsession extends auth
|
||||
@param string $newpassword The new password to be recorded */
|
||||
public function changepassword ($oldpassword, $newpassword)
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The password can't be change for SESSION users"),
|
||||
405);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ class authshibboleth extends auth
|
||||
{
|
||||
// Redirect to Shibboleth IDP
|
||||
if ($this->urlPasswdChange == "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The password can't be change for Shibboleth users"),
|
||||
405);
|
||||
$route = new route ();
|
||||
|
||||
@@ -125,7 +125,7 @@ class authsql extends auth
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Can't change the password if the user is not authenticated"),
|
||||
500);
|
||||
$data = $this->db->read (array (array ($this->fieldIdentifier,
|
||||
$data = $this->db->read (array (array ($this->fieldIdentifier,
|
||||
$this->details[$this->fieldIdentifier])),
|
||||
array ($this->fieldIdentifier,
|
||||
$this->fieldPassword));
|
||||
@@ -143,7 +143,7 @@ class authsql extends auth
|
||||
));
|
||||
//now do the actual hashing
|
||||
$cryptpassword = crypt ($newpassword, $param);
|
||||
$rc = $this->db->update ($this->details[$this->fieldIdentifier],
|
||||
$rc = $this->db->update ($this->details[$this->fieldIdentifier],
|
||||
array ($this->fieldPassword => $cryptpassword));
|
||||
if ($rc !== 1)
|
||||
throw new Exception (dgettext("domframework",
|
||||
@@ -177,7 +177,7 @@ class authsql extends auth
|
||||
));
|
||||
//now do the actual hashing
|
||||
$cryptpassword = crypt ($newpassword, $param);
|
||||
$rc = $this->db->update ($email,
|
||||
$rc = $this->db->update ($email,
|
||||
array ($this->fieldPassword => $cryptpassword));
|
||||
if ($rc !== 1)
|
||||
throw new Exception (dgettext("domframework","Can't change the password"),
|
||||
|
||||
@@ -41,7 +41,7 @@ class authsympa extends auth
|
||||
public function __construct ()
|
||||
{
|
||||
if (! class_exists ("SoapClient"))
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"No SOAP PHP library available"), 500);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class authsympa extends auth
|
||||
public function connect ()
|
||||
{
|
||||
if ($this->wsdl === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"No WSDL provided to Sympa auth"), 401);
|
||||
$this->client = new SoapClient($this->wsdl);
|
||||
}
|
||||
@@ -60,14 +60,14 @@ class authsympa extends auth
|
||||
public function authentication ($email, $password)
|
||||
{
|
||||
if ($this->client === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The SOAP connection is not opened"), 401);
|
||||
if ($this->list === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The list to check is not defined"), 401);
|
||||
$this->authkey = $this->client->login ($email, $password);
|
||||
if ($this->authkey === null)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Can't connect with provided email/password to sympa"),
|
||||
401);
|
||||
$this->email = $email;
|
||||
@@ -81,7 +81,7 @@ class authsympa extends auth
|
||||
/** Return all the parameters recorded for the authenticate user */
|
||||
public function getdetails ()
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The details can't be provided by Sympa"), 404);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class authsympa extends auth
|
||||
@param string $newpassword The new password to be recorded */
|
||||
public function changepassword ($oldpassword, $newpassword)
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"The password can't be change for SYMPA users"),
|
||||
405);
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class authzgroups
|
||||
".$this->tableprefix."authzobject AS o,
|
||||
".$this->tableprefix."authzgroup AS g,
|
||||
".$this->tableprefix."authzgroupmember AS gm
|
||||
WHERE r.idgroup=g.idgroup AND r.idobject=o.idobject AND
|
||||
WHERE r.idgroup=g.idgroup AND r.idobject=o.idobject AND
|
||||
gm.idgroup=g.idgroup
|
||||
AND gm.user=:user AND g.module=:module
|
||||
GROUP BY o.object
|
||||
@@ -110,7 +110,7 @@ class authzgroups
|
||||
// The complete tree should not be readable for the user : it can have
|
||||
// access to a card, but not to all the cards (group -> reject,
|
||||
// group/XXX->allow)
|
||||
/*// Limit to allowed trees : if a member of the path is not recorded (is
|
||||
/*// Limit to allowed trees : if a member of the path is not recorded (is
|
||||
// unreadable), return NO.
|
||||
// Can be the last entry (the complete object) too
|
||||
$path = explode ("/", $object);
|
||||
@@ -119,7 +119,7 @@ class authzgroups
|
||||
{
|
||||
if ($k>1)
|
||||
$completePath .= "/";
|
||||
$completePath .= "$p";
|
||||
$completePath .= "$p";
|
||||
if (! isset ($ressource[$completePath]))
|
||||
{
|
||||
if ($this->debug)
|
||||
@@ -132,7 +132,7 @@ class authzgroups
|
||||
return $ressource[$object];
|
||||
}
|
||||
|
||||
/** Return TRUE if the user right allow to see the object (RO or RW)
|
||||
/** Return TRUE if the user right allow to see the object (RO or RW)
|
||||
Return a 403 Exception if the user don't have the right
|
||||
Return a 401 Exception if the user is not connected */
|
||||
public function accessRight ($module, $user, $object)
|
||||
@@ -246,7 +246,7 @@ class authzgroups
|
||||
$this->dbObject->unique = array ("idobject", array ("object", "module"));
|
||||
$this->dbObject->titles = array ("idobject"=>dgettext("domframework",
|
||||
"idobject"),
|
||||
"module"=>dgettext("domframework",
|
||||
"module"=>dgettext("domframework",
|
||||
"Module"),
|
||||
"object"=>dgettext("domframework",
|
||||
"Object"),
|
||||
@@ -354,7 +354,7 @@ class authzgroups
|
||||
$tables = array ("Object", "Group", "GroupMember", "Right");
|
||||
foreach ($tables as $table)
|
||||
{
|
||||
try
|
||||
try
|
||||
{
|
||||
$class= "db$table";
|
||||
$this->$class->createTable ();
|
||||
@@ -988,9 +988,9 @@ class authzgroups
|
||||
throw new Exception (dgettext ("domframework",
|
||||
"DB for Right is not connected"), 500);
|
||||
$select[] = array ("idright", $idright);
|
||||
return $this->dbRight->read ($select);
|
||||
return $this->dbRight->read ($select);
|
||||
}
|
||||
|
||||
|
||||
/** Return an array with all the available rights for a module and an object
|
||||
*/
|
||||
public function rightReadByObject ($module, $object)
|
||||
@@ -1003,7 +1003,7 @@ class authzgroups
|
||||
throw new Exception (dgettext ("domframework",
|
||||
"Wanted object not found"), 404);
|
||||
$select[] = array ("idobject", $objects[0]["idobject"]);
|
||||
return $this->dbRight->read ($select);
|
||||
return $this->dbRight->read ($select);
|
||||
}
|
||||
|
||||
/** Return an array with all the available rights for a module and an idobject
|
||||
|
||||
@@ -74,29 +74,28 @@ class cachefile
|
||||
public function cachedir ()
|
||||
{
|
||||
if (! isset ($this->directory) || $this->directory === "")
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"No cache directory defined"), 500);
|
||||
if (! file_exists ($this->directory))
|
||||
{
|
||||
// Need to create the cache dir
|
||||
$parent = realpath (dirname ($this->directory));
|
||||
if (! is_writeable (dirname ($this->directory)))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Directory %s is not writable : can not create cache directory"),
|
||||
$parent), 500);
|
||||
if (!mkdir ($this->directory))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Can not create cache directory %s"),
|
||||
$this->directory), 500);
|
||||
chmod ($this->directory, 0777);
|
||||
}
|
||||
if (! is_writable ($this->directory))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Cache directory %s is not writable"),
|
||||
$this->directory), 500);
|
||||
if (! is_readable ($this->directory))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Cache directory %s is not readable"),
|
||||
$this->directory), 500);
|
||||
if (!file_exists ($this->directory."/.htaccess"))
|
||||
@@ -115,7 +114,7 @@ class cachefile
|
||||
if ($this->nocache !== false)
|
||||
return false;
|
||||
if ($data === false)
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Can not store FALSE in cache"), 500);
|
||||
try
|
||||
{
|
||||
@@ -159,11 +158,11 @@ class cachefile
|
||||
if (!file_exists ($fileCache))
|
||||
return false;
|
||||
if (!is_readable ($fileCache))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"File cache %s is not readable"),
|
||||
$fileCache), 500);
|
||||
if (!is_writable ($fileCache))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"File cache %s is not writable"),
|
||||
$fileCache), 500);
|
||||
// Lock : waiting the reconstruction of the cache by another process
|
||||
|
||||
@@ -27,7 +27,7 @@ class cacheoutput
|
||||
{
|
||||
$res = @include ("domframework/cache$method.php");
|
||||
if ($res === false)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Unkwnown cache method : "), $method),
|
||||
500);
|
||||
$this->id = $id;
|
||||
|
||||
14
config.php
14
config.php
@@ -76,12 +76,12 @@ class config
|
||||
if (@file_put_contents ($this->confFile,
|
||||
"<?php\r\n\$conf = array ();\r\n")
|
||||
=== FALSE)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"No configuration file '%s' available and it can't be created"),
|
||||
$this->confFile), 500);
|
||||
}
|
||||
elseif (! is_readable ($this->confFile))
|
||||
throw new Exception (sprintf ( dgettext("domframework",
|
||||
throw new Exception (sprintf ( dgettext("domframework",
|
||||
"The configuration file '%s' is not readable"),
|
||||
$this->confFile));
|
||||
$conf = array ();
|
||||
@@ -145,11 +145,11 @@ class config
|
||||
}
|
||||
elseif (! is_readable ($this->confFile))
|
||||
throw new Exception (sprintf (
|
||||
dgettext("domframework",
|
||||
dgettext("domframework",
|
||||
"The configuration file '%s' is not readable"),
|
||||
$this->confFile), 500);
|
||||
if (!is_writeable ($this->confFile))
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Configuration file '%s' is write protected"),
|
||||
$this->confFile), 500);
|
||||
$conf = array ();
|
||||
@@ -164,7 +164,7 @@ class config
|
||||
$txt .= ");\r\n";
|
||||
|
||||
if (@file_put_contents ($this->confFile, $txt, LOCK_EX) === FALSE)
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
throw new Exception (sprintf (dgettext("domframework",
|
||||
"Can't save configuration file '%s'"),
|
||||
$this->confFile), 500);
|
||||
return TRUE;
|
||||
@@ -200,7 +200,7 @@ class config
|
||||
$phpcode .= "),\r\n";
|
||||
}
|
||||
else
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Config : missing type ").gettype ($val), 500);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ class config
|
||||
$val = trim ($val);
|
||||
if (strpos ($val, "=>") !== false)
|
||||
{
|
||||
// Associated array
|
||||
// Associated array
|
||||
unset ($values[$key]);
|
||||
list ($key1, $val1) = explode ("=>", $val);
|
||||
$key1 = trim ($key1);
|
||||
|
||||
6
csrf.php
6
csrf.php
@@ -42,18 +42,18 @@ class csrf
|
||||
return TRUE;
|
||||
if (! isset ($_SESSION["domframework"]["csrf"]["csrf"]))
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"No previous CSRF token : abort"), 406);
|
||||
}
|
||||
if ($_SESSION["domframework"]["csrf"]["csrf"] !== $tokenFromUser)
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Invalid CSRF token provided"), 406);
|
||||
}
|
||||
if (($_SESSION["domframework"]["csrf"]["csrfStart"] + $this->csrfTimeout) <
|
||||
microtime (TRUE))
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Obsolete CSRF token provided"), 406);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
* array ("key"=>"val", "key2"=>"val2") <== Look for two parameters
|
||||
* - A document is an array containing the fields and the values to store
|
||||
* array ("key"=>"val)
|
||||
*
|
||||
*
|
||||
* - The field named _id is the document key
|
||||
*/
|
||||
|
||||
@@ -279,12 +279,12 @@ class dbjson
|
||||
* array () <== Look for all the documents (no
|
||||
* filter)
|
||||
* array ("key"=>"val") <== Look for the key equal val
|
||||
* array ("key=>array ("val", "<=")) <== Look for the key lighter or
|
||||
* array ("key=>array ("val", "<=")) <== Look for the key lighter or
|
||||
* equal than val
|
||||
* array ("key"=>"val", "key2"=>"val2") <== Look for two parameters
|
||||
* array ("key"=>array ("val", "=="),
|
||||
* "key2"=>array ("val2", "==")) <== Look for two complex parameters
|
||||
* Here is the comparison types available : ==,
|
||||
* Here is the comparison types available : ==,
|
||||
* @return array the keys matching the filter
|
||||
*/
|
||||
public function filter ($collection, $filter)
|
||||
@@ -362,7 +362,7 @@ class dbjson
|
||||
}
|
||||
return $keys;
|
||||
}
|
||||
|
||||
|
||||
/** Generate a unique key
|
||||
* @return string the Unique key generated
|
||||
*/
|
||||
|
||||
@@ -1429,7 +1429,7 @@ class dblayer
|
||||
|
||||
}
|
||||
|
||||
/** Hook postread
|
||||
/** Hook postread
|
||||
This hook is run after selecting the data.
|
||||
@param array $data the data selected by the select
|
||||
@return array The data modified by the hook */
|
||||
|
||||
@@ -66,7 +66,7 @@ class dblayerauthzgroups extends dblayer
|
||||
}
|
||||
}
|
||||
|
||||
/** Hook postread
|
||||
/** Hook postread
|
||||
This hook is run after selecting the data. Return only the allowed data to
|
||||
the user. It must have at least the RO flag.
|
||||
@param array $data the data selected by the select
|
||||
@@ -98,13 +98,13 @@ class dblayerauthzgroups extends dblayer
|
||||
}
|
||||
if ($this->primaryKeyAdded === true)
|
||||
unset ($data[$key][$this->primary]);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** Hook preinsert
|
||||
This hook is run before inserting a new data in the database, after the
|
||||
verification
|
||||
This hook is run before inserting a new data in the database, after the
|
||||
verification
|
||||
@param array the data to insert in the database
|
||||
@return the modified data */
|
||||
public function hookpreinsert ($data)
|
||||
@@ -186,7 +186,7 @@ class dblayerauthzgroups extends dblayer
|
||||
500);
|
||||
$this->allowPath ();
|
||||
$this->authzgroups->accessWrite ($this->module, $this->user, $this->path);
|
||||
$this->authzgroups->accessWrite ($this->module, $this->user,
|
||||
$this->authzgroups->accessWrite ($this->module, $this->user,
|
||||
$this->path."/$updatekey");
|
||||
return $data;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ class dblayerauthzgroups extends dblayer
|
||||
500);
|
||||
$this->allowPath ();
|
||||
$this->authzgroups->accessWrite ($this->module, $this->user, $this->path);
|
||||
$this->authzgroups->accessWrite ($this->module, $this->user,
|
||||
$this->authzgroups->accessWrite ($this->module, $this->user,
|
||||
$this->path."/$deletekey");
|
||||
return $deletekey;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ class dblayerauthzgroups extends dblayer
|
||||
$this->module = $module;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/** Set the auth property */
|
||||
public function authSet ($auth)
|
||||
{
|
||||
@@ -288,21 +288,21 @@ class dblayerauthzgroups extends dblayer
|
||||
$this->user = $user;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/** Set the createGroup property */
|
||||
public function createGroupSet ($createGroup)
|
||||
{
|
||||
$this->createGroup = $createGroup;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/** Set the createRight property */
|
||||
public function createRightSet ($createRight)
|
||||
{
|
||||
$this->createRight = $createRight;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/** Set the path property */
|
||||
public function pathSet ($path)
|
||||
{
|
||||
|
||||
10
form.php
10
form.php
@@ -79,7 +79,7 @@ class form
|
||||
$this->fields = $fields;
|
||||
}
|
||||
|
||||
/** Add a field to the form. For the details of a field, see the description
|
||||
/** Add a field to the form. For the details of a field, see the description
|
||||
* in fields method */
|
||||
public function addfield ($field)
|
||||
{
|
||||
@@ -104,7 +104,7 @@ class form
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception (dgettext("domframework",
|
||||
throw new Exception (dgettext("domframework",
|
||||
"Unknown FORM method (GET or POST allowed)"));
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ class form
|
||||
{
|
||||
reset ($errors);
|
||||
$focusElement = key ($errors);
|
||||
}
|
||||
}
|
||||
$res .= "<script>document.getElementById('".$this->formName."_".
|
||||
$focusElement."').focus();</script>\n";
|
||||
$res .= "</form>\n";
|
||||
@@ -463,8 +463,8 @@ class formfield
|
||||
$this->values[$key] !== "unset" &&
|
||||
$this->values[$key] !== "")
|
||||
$res .= " checked='checked'";
|
||||
elseif (isset ($this->defaults[$key]) &&
|
||||
$this->defaults[$key] !== null &&
|
||||
elseif (isset ($this->defaults[$key]) &&
|
||||
$this->defaults[$key] !== null &&
|
||||
$this->defaults[$key] !== false &&
|
||||
$this->defaults[$key] !== "unset" &&
|
||||
$this->defaults[$key] !== "")
|
||||
|
||||
16
imap.php
16
imap.php
@@ -168,7 +168,7 @@ class imap
|
||||
$res = array ();
|
||||
foreach ($subs as $sub)
|
||||
{
|
||||
$res [] = str_replace ($sub->delimiter, "/",
|
||||
$res [] = str_replace ($sub->delimiter, "/",
|
||||
substr ($sub->name, strlen ($this->mailbox)));
|
||||
}
|
||||
$res = array_map (function ($folder) {
|
||||
@@ -272,7 +272,7 @@ class imap
|
||||
if ($from < 1)
|
||||
$from = 1;
|
||||
if ($from > $MC->Nmsgs)
|
||||
throw new Exception ("Mail start is higher than the number of mails",
|
||||
throw new Exception ("Mail start is higher than the number of mails",
|
||||
500);
|
||||
$from = $MC->Nmsgs - $from + 1;
|
||||
$to = $from + $nbmails - 1;
|
||||
@@ -282,7 +282,7 @@ class imap
|
||||
else
|
||||
{
|
||||
if ($from > $MC->Nmsgs)
|
||||
throw new Exception ("Mail start is higher than the number of mails",
|
||||
throw new Exception ("Mail start is higher than the number of mails",
|
||||
500);
|
||||
if ($from < 1)
|
||||
$from = 1;
|
||||
@@ -535,7 +535,7 @@ class imap
|
||||
strtolower ($struct2->subtype);
|
||||
else
|
||||
throw new Exception (sprintf (
|
||||
dgettext("domframework",
|
||||
dgettext("domframework",
|
||||
"Unknown type in imap_fetchstructure : %s"),
|
||||
$struct2->type), 500);
|
||||
}
|
||||
@@ -581,7 +581,7 @@ class imap
|
||||
strtolower ($struct1->subtype);
|
||||
else
|
||||
throw new Exception (sprintf (
|
||||
dgettext("domframework",
|
||||
dgettext("domframework",
|
||||
"Unknown type in imap_fetchstructure : %s"),
|
||||
$struct1->type), 500);
|
||||
}
|
||||
@@ -665,7 +665,7 @@ class imap
|
||||
imap_errors();
|
||||
if (! isset ($quota["STORAGE"]))
|
||||
return array ();
|
||||
|
||||
|
||||
return array_map (function ($n) {return intval ($n/1000);},
|
||||
$quota["STORAGE"]);
|
||||
}
|
||||
@@ -688,7 +688,7 @@ class imap
|
||||
$this->changeFolder ($this->curDir);
|
||||
if (is_array ($msgno))
|
||||
$msgno = implode (",", $msgno);
|
||||
$rc = @imap_setflag_full (self::$instance[$this->mailbox], $msgno,
|
||||
$rc = @imap_setflag_full (self::$instance[$this->mailbox], $msgno,
|
||||
implode (" ", $flags));
|
||||
imap_errors();
|
||||
if ($rc === FALSE)
|
||||
@@ -712,7 +712,7 @@ class imap
|
||||
$this->changeFolder ($this->curDir);
|
||||
if (is_array ($msgno))
|
||||
$msgno = implode (",", $msgno);
|
||||
$rc = @imap_clearflag_full (self::$instance[$this->mailbox], $msgno,
|
||||
$rc = @imap_clearflag_full (self::$instance[$this->mailbox], $msgno,
|
||||
implode (" ", $flags));
|
||||
imap_errors();
|
||||
if ($rc === FALSE)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class inifile
|
||||
{
|
||||
/** Return an array with the .ini file content
|
||||
If the sections are true, the sections are analyzed too
|
||||
If the sections are true, the sections are analyzed too
|
||||
This function is the same as parse_ini_file PHP internal */
|
||||
public function getFile ($file, $sections=false)
|
||||
{
|
||||
@@ -22,7 +22,7 @@ class inifile
|
||||
}
|
||||
|
||||
/** Return an array with the .ini string content
|
||||
If the sections are true, the sections are analyzed too
|
||||
If the sections are true, the sections are analyzed too
|
||||
This function is the same as parse_ini_string PHP internal */
|
||||
public function getString ($string, $sections=false)
|
||||
{
|
||||
@@ -48,11 +48,11 @@ class inifile
|
||||
elseif ($v === "false")
|
||||
$res[$key][$k] = false;
|
||||
elseif (is_numeric ($v))
|
||||
$res[$key][$k] = $v + 0;
|
||||
$res[$key][$k] = $v + 0;
|
||||
}
|
||||
}
|
||||
elseif (is_numeric ($val))
|
||||
$res[$key] = $val + 0;
|
||||
$res[$key] = $val + 0;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ class ipaddresses
|
||||
|
||||
/* Get an IPv6 address with the format
|
||||
x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x
|
||||
and return it with format
|
||||
and return it with format
|
||||
xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
|
||||
Return false if the IP provided is not complete */
|
||||
public function groupIPv6 ($ipv6)
|
||||
|
||||
10
language.php
10
language.php
@@ -23,7 +23,7 @@ class language
|
||||
/** Language cache directory */
|
||||
public $cacheDir = "data/locale";
|
||||
|
||||
/** Choose the best language in the browser list and which is available in
|
||||
/** Choose the best language in the browser list and which is available in
|
||||
locale path
|
||||
@param string|null $repLocale Directory where are stored the translations
|
||||
@param string|null $languageCode The coding langugage of the soft
|
||||
@@ -89,7 +89,7 @@ class language
|
||||
foreach ($arrAccept as $value)
|
||||
{
|
||||
// Regarde si un repertoire existe avec la language proposee.
|
||||
// Recherche insensible à la casse, retourne le nom du fichier avec la
|
||||
// Recherche insensible à la casse, retourne le nom du fichier avec la
|
||||
// casse
|
||||
$val2 = strtolower ($value);
|
||||
foreach ($arrLanguageAvailable as $val)
|
||||
@@ -141,7 +141,7 @@ class language
|
||||
return $_COOKIE[$cookieName];
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/** Set the cookie with a TTL of one month
|
||||
@param string $cookieName The name of the cookie
|
||||
@param string $languageCode Language to store
|
||||
@@ -275,7 +275,7 @@ class language
|
||||
$codeset = "UTF8"; // SANS TIRET ET EN MAJSUCULES!!!
|
||||
// -> Le répertoire de données doit être fr_FR.UTF8
|
||||
putenv ('LANG='.$languageCode.'.'.$codeset);
|
||||
putenv ('LANGUAGE='.$languageCode.'.'.$codeset);
|
||||
putenv ('LANGUAGE='.$languageCode.'.'.$codeset);
|
||||
$GLOBALS["domframework"]["lang"] = $languageCode;
|
||||
bind_textdomain_codeset ($package, "utf-8");
|
||||
bindtextdomain ($package, $repLocale);
|
||||
@@ -338,7 +338,7 @@ class language
|
||||
case "fr_FR": return dgettext("domframework", "French");
|
||||
case "en_US": return dgettext("domframework", "English (US)");
|
||||
case "en_GB": return dgettext("domframework", "English (GB)");
|
||||
default:
|
||||
default:
|
||||
throw new Exception ("No language available for '$languageCode'", 500);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ class logger
|
||||
// Add the filename which generate the error
|
||||
$msg .= " [".basename ($back["file"]).":".$back["line"]."]";
|
||||
|
||||
// Display the backtrace if it is needed
|
||||
// Display the backtrace if it is needed
|
||||
if ($this->backtraceDisplay)
|
||||
{
|
||||
$e = new Exception();
|
||||
|
||||
2
mail.php
2
mail.php
@@ -99,7 +99,7 @@ class mail
|
||||
*/
|
||||
private function sectionDel ($sectionID)
|
||||
{
|
||||
// TODO !
|
||||
// TODO !
|
||||
}
|
||||
|
||||
/** Add a newChild to an existing section at the end of the list
|
||||
|
||||
@@ -137,7 +137,7 @@ class markdown
|
||||
$pos++;
|
||||
}
|
||||
// Insert Geshi on $content
|
||||
if ($this->debug)
|
||||
if ($this->debug)
|
||||
echo "RETURN typeCode : <pre><code>$content</code></pre>\n";
|
||||
return "<pre><code>$content</code></pre>\n";
|
||||
}
|
||||
@@ -175,7 +175,7 @@ class markdown
|
||||
$blockStart = $pos;
|
||||
$blockContent = "";
|
||||
while (isset ($text[$pos]) &&
|
||||
$this->depth($text[$pos]) >= $depth &&
|
||||
$this->depth($text[$pos]) >= $depth &&
|
||||
$this->lineType ($text[$pos]) === $type)
|
||||
{
|
||||
if ($this->debug)
|
||||
@@ -251,7 +251,7 @@ class markdown
|
||||
// linetype changed
|
||||
$Pinc = $pos;
|
||||
while (isset ($text[$pos]) &&
|
||||
$this->depth($text[$pos]) == $depth &&
|
||||
$this->depth($text[$pos]) == $depth &&
|
||||
$this->lineType ($text[$pos]) === "p")
|
||||
{
|
||||
if (substr ($text[$pos], -2) === " ")
|
||||
@@ -312,7 +312,7 @@ class markdown
|
||||
" < $depth)\n";
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
$type = $this->lineType ($text[$pos]);
|
||||
$func = "type$type";
|
||||
if ($this->debug)
|
||||
|
||||
@@ -8,8 +8,8 @@ class module
|
||||
{
|
||||
/** The modules are not allowed if $toplevel=0
|
||||
The modules can be in a module directory if $toplevel=1
|
||||
The modules can be in the parent directory if $toplevel=2
|
||||
The modules can be in the local directory if $toplevel=4
|
||||
The modules can be in the parent directory if $toplevel=2
|
||||
The modules can be in the local directory if $toplevel=4
|
||||
The values can be added to allow multiple possibilities */
|
||||
public $toplevel = 0;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class outputhtml extends output
|
||||
$title = $resView["title"];
|
||||
if (! isset ($resView["content"]))
|
||||
throw new Exception (sprintf (
|
||||
dgettext("domframework",
|
||||
dgettext("domframework",
|
||||
"No data provided from view %s::%s"),
|
||||
$viewClass,$viewMethod),
|
||||
500);
|
||||
@@ -132,12 +132,12 @@ EOT;
|
||||
/** Get the layout and provide it the variables. The variables will be push in
|
||||
* global to the layout (they can be used like $XX)
|
||||
* @param string the layout file to load
|
||||
* @param array $variables The variables array to push to the layout
|
||||
* @param array $variables The variables array to push to the layout
|
||||
* @return string the Layout with variables interpreted */
|
||||
private function layoutVariables ($layout, $variables)
|
||||
{
|
||||
// The layout can be a external layout file or the HTML page itself.
|
||||
// FIXME : Allow to manage variables in a layout provided in the variable,
|
||||
// FIXME : Allow to manage variables in a layout provided in the variable,
|
||||
// without eval use
|
||||
if (! file_exists ($layout))
|
||||
return $layout;
|
||||
|
||||
@@ -11,7 +11,7 @@ class ratelimit
|
||||
/** The unit time in seconds */
|
||||
public $unittime = 60;
|
||||
|
||||
/** The function set a rate-limit
|
||||
/** The function set a rate-limit
|
||||
@return bool true if the rate-limit is not overloaded
|
||||
false if the rate-limit is overloaded */
|
||||
public function set ($name)
|
||||
|
||||
@@ -14,7 +14,7 @@ class ratelimitfile extends ratelimit
|
||||
/** Debug the ratelimiting process to screen */
|
||||
public $debug = false;
|
||||
|
||||
/** The function set a rate-limit
|
||||
/** The function set a rate-limit
|
||||
@return bool true if the rate-limit is not overloaded
|
||||
false if the rate-limit is overloaded */
|
||||
public function set ($name)
|
||||
|
||||
@@ -107,7 +107,7 @@ class renderer
|
||||
require_once ("domframework/outputhtml.php");
|
||||
if ($route === null)
|
||||
$route = new route ();
|
||||
// Return a $dataflash with the displayed flash in Bootstrap
|
||||
// Return a $dataflash with the displayed flash in Bootstrap
|
||||
$dataflash = "";
|
||||
if (isset ($_SESSION["renderer"]["flash"]))
|
||||
{
|
||||
@@ -145,7 +145,7 @@ class renderer
|
||||
}
|
||||
|
||||
$html = new outputhtml ();
|
||||
$replacement = array_merge ($replacement,
|
||||
$replacement = array_merge ($replacement,
|
||||
array ("{baseurl}"=>$route->baseURL (),
|
||||
"{baseurlresource}"=>$route->baseURLresource (),
|
||||
"{flash}"=>$dataflash));
|
||||
|
||||
@@ -58,7 +58,7 @@ class route
|
||||
/** Array to variable definition */
|
||||
public $variable = array ();
|
||||
|
||||
/** The route constructor : initialize the parameters */
|
||||
/** The route constructor : initialize the parameters */
|
||||
function __construct ()
|
||||
{
|
||||
$this->ratelimiter = new ratelimitfile ();
|
||||
@@ -99,7 +99,7 @@ class route
|
||||
if (substr ($this->baseURL, -1) !== "/")
|
||||
$this->baseURL .= "/";
|
||||
}
|
||||
elseif (isset ($_SERVER["REQUEST_URI"]) &&
|
||||
elseif (isset ($_SERVER["REQUEST_URI"]) &&
|
||||
strpos ($_SERVER["REQUEST_URI"], "index.php?url=") !== false)
|
||||
{
|
||||
$this->baseURL = "";
|
||||
@@ -139,7 +139,6 @@ class route
|
||||
strpos ($_SERVER["REQUEST_URI"], "index.php?url=") !== false)
|
||||
return "index.php?url=".$this->baseURL;
|
||||
return $this->baseURL;
|
||||
|
||||
}
|
||||
|
||||
/** Return the baseURL of the module
|
||||
@@ -187,7 +186,7 @@ class route
|
||||
}
|
||||
if (isset ($_SERVER["REQUEST_URI"]))
|
||||
{
|
||||
// If there is a directory before the index.php file, must remove the
|
||||
// If there is a directory before the index.php file, must remove the
|
||||
// directory structure
|
||||
if (dirname ($_SERVER["SCRIPT_NAME"]) !== "/")
|
||||
$url .= substr ($_SERVER["REQUEST_URI"],
|
||||
|
||||
48
routeSQL.php
48
routeSQL.php
@@ -9,7 +9,7 @@ require_once ("domframework/renderer.php");
|
||||
|
||||
error_reporting (E_ALL);
|
||||
|
||||
/** Automatic Routing for SQL database
|
||||
/** Automatic Routing for SQL database
|
||||
Allow to do CRUD on data with only one line in index.php */
|
||||
class routeSQL
|
||||
{
|
||||
@@ -46,8 +46,8 @@ class routeSQL
|
||||
public $authHTML = array ("email"=>"anonymous");
|
||||
/** Authentication for REST part */
|
||||
public $authREST = array ("email"=>"anonymous");
|
||||
/** Authorization object. Should allow a method named
|
||||
"allow ($module, $user, $object)" which return
|
||||
/** Authorization object. Should allow a method named
|
||||
"allow ($module, $user, $object)" which return
|
||||
- NO if the object is not defined
|
||||
- RO if the object is in read-only mode
|
||||
- RW if the object is in read-write mode */
|
||||
@@ -75,8 +75,8 @@ class routeSQL
|
||||
private $model_file = "";
|
||||
/** The model class included in the model file */
|
||||
private $model_class = "";
|
||||
/** The prefix to be used in the URL. Should be the end of $model_file
|
||||
Ex : if $model_file = models/model_zone.php, the url_prefix should be
|
||||
/** The prefix to be used in the URL. Should be the end of $model_file
|
||||
Ex : if $model_file = models/model_zone.php, the url_prefix should be
|
||||
zone */
|
||||
private $url_prefix = "";
|
||||
/** The SQL object created */
|
||||
@@ -371,7 +371,7 @@ $content .= "</li>\n";
|
||||
// Limiting access to data only to data with read access right
|
||||
foreach ($data as $key=>$vals)
|
||||
{
|
||||
if ($this->accessright ($this->authHTML["email"],
|
||||
if ($this->accessright ($this->authHTML["email"],
|
||||
$vals[$this->objectDB->primary]) !== TRUE)
|
||||
unset ($data[$key]);
|
||||
}
|
||||
@@ -427,7 +427,7 @@ $content .= "</li>\n";
|
||||
if ($this->chainedForeign !== null &&
|
||||
isset ($values[$this->chainedForeign]) &&
|
||||
$values[$this->chainedForeign] !== $chain)
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
array ("error", dgettext("domframework",
|
||||
"Can not change the external key"));
|
||||
if ($this->chainedForeign !== null)
|
||||
@@ -495,7 +495,7 @@ $content .= "</li>\n";
|
||||
if ($this->chainedForeign !== null &&
|
||||
isset ($values[$this->chainedForeign]) &&
|
||||
$values[$this->chainedForeign] !== $chain)
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
array ("error", dgettext("domframework",
|
||||
"Can not change the external key"));
|
||||
$errors = $this->objectDB->verify ($values, $id);
|
||||
@@ -576,7 +576,7 @@ $content .= "</li>\n";
|
||||
{
|
||||
if (strpos ($this->chained->url_prefix, "/{chain}/") !== false)
|
||||
throw new Exception ("Chained can not have an already chained object",
|
||||
500);
|
||||
500);
|
||||
$this->url_prefix = $this->chained->url_prefix."/{chain}/".
|
||||
$this->url_prefix;
|
||||
}
|
||||
@@ -693,7 +693,7 @@ $content .= "</li>\n";
|
||||
// Limiting access to data only to data with read access right
|
||||
foreach ($data as $key=>$vals)
|
||||
{
|
||||
if ($this->accessright ($this->authHTML["email"],
|
||||
if ($this->accessright ($this->authHTML["email"],
|
||||
$vals[$this->objectDB->primary]) !== TRUE)
|
||||
unset ($data[$key]);
|
||||
}
|
||||
@@ -757,7 +757,7 @@ $content .= "</li>\n";
|
||||
}
|
||||
|
||||
|
||||
$content = "";
|
||||
$content = "";
|
||||
// Internal CSS
|
||||
if ($this->enableInternalCSS === true)
|
||||
{
|
||||
@@ -984,7 +984,7 @@ $content .= "</li>\n";
|
||||
|
||||
});
|
||||
|
||||
$route->get ($this->url_prefix."/add", function ($chain=null)
|
||||
$route->get ($this->url_prefix."/add", function ($chain=null)
|
||||
{
|
||||
// Add a new entry : form to be filled by the user
|
||||
if ($this->chained !== null)
|
||||
@@ -1143,7 +1143,7 @@ $content .= "</li>\n";
|
||||
$this->rendererhtml ($content);
|
||||
});
|
||||
|
||||
$route->post ($this->url_prefix."/add", function ($chain=null) use ($route)
|
||||
$route->post ($this->url_prefix."/add", function ($chain=null) use ($route)
|
||||
{
|
||||
// Add a new entry : effective save of the data
|
||||
if ($this->chained !== null)
|
||||
@@ -1188,7 +1188,7 @@ $content .= "</li>\n";
|
||||
if ($this->chainedForeign !== null &&
|
||||
isset ($values[$this->chainedForeign]) &&
|
||||
$values[$this->chainedForeign] !== $chain)
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
array ("error", dgettext("domframework",
|
||||
"Can not change the external key"));
|
||||
$errors = $this->objectDB->verify ($values);
|
||||
@@ -1197,8 +1197,8 @@ $content .= "</li>\n";
|
||||
try
|
||||
{
|
||||
$this->objectDB->insert ($values);
|
||||
$renderer = new renderer ();
|
||||
$renderer->flash ("SUCCESS", dgettext("domframework",
|
||||
$renderer = new renderer ();
|
||||
$renderer->flash ("SUCCESS", dgettext("domframework",
|
||||
"Creation done"));
|
||||
$route->redirect ("/".
|
||||
str_replace ("{chain}", $chain, $this->url_prefix),
|
||||
@@ -1257,7 +1257,7 @@ $content .= "</li>\n";
|
||||
$this->chained->editright ($this->authHTML["email"], $chain) !== true)
|
||||
$this->readwriteAllowed = false;
|
||||
if ($this->readwriteAllowed === true)
|
||||
$this->readwriteAllowed = $this->editright ($this->authHTML["email"],
|
||||
$this->readwriteAllowed = $this->editright ($this->authHTML["email"],
|
||||
$id);
|
||||
$readonly = $this->readonly ($this->authHTML["email"], $id);
|
||||
|
||||
@@ -1429,8 +1429,8 @@ $content .= "</li>\n";
|
||||
if ($this->readonly ($this->authHTML["email"], $id) === TRUE)
|
||||
throw new Exception (dgettext("domframework","Access forbidden"), 403);
|
||||
|
||||
$this->connect();
|
||||
$oldvalues = $this->objectDB->read (array (array
|
||||
$this->connect();
|
||||
$oldvalues = $this->objectDB->read (array (array
|
||||
($this->objectDB->primary, $id)));
|
||||
if (count ($oldvalues) === 0)
|
||||
throw new Exception (dgettext("domframework", "Object not found"), 404);
|
||||
@@ -1444,7 +1444,7 @@ $content .= "</li>\n";
|
||||
if ($this->chainedForeign !== null &&
|
||||
isset ($values[$this->chainedForeign]) &&
|
||||
$values[$this->chainedForeign] !== $chain)
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
$errorsChain[$this->chainedForeign] =
|
||||
array ("error", dgettext("domframework",
|
||||
"Can not change the external key"));
|
||||
if ($this->chainedForeign !== null)
|
||||
@@ -1455,7 +1455,7 @@ $content .= "</li>\n";
|
||||
try
|
||||
{
|
||||
$this->objectDB->update ($id, $values);
|
||||
$renderer = new renderer ();
|
||||
$renderer = new renderer ();
|
||||
$renderer->flash ("SUCCESS", dgettext("domframework","Update done"));
|
||||
$route->redirect ("/".
|
||||
str_replace ("{chain}", $chain, $this->url_prefix),
|
||||
@@ -1500,7 +1500,7 @@ $content .= "</li>\n";
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Authorization : Return TRUE if the user right allow to edit the data
|
||||
/** Authorization : Return TRUE if the user right allow to edit the data
|
||||
Return FALSE else */
|
||||
public function editright ($auth, $id=null)
|
||||
{
|
||||
@@ -1508,7 +1508,7 @@ $content .= "</li>\n";
|
||||
// var_export($this->model_class, TRUE)."\n";
|
||||
if ($this->authorization !== null)
|
||||
{
|
||||
$result = $this->authorization->allow ($this->module, $auth,
|
||||
$result = $this->authorization->allow ($this->module, $auth,
|
||||
"/".$this->model_class."/$id");
|
||||
// echo "RESULT=$result\n";
|
||||
if ($result === "RW") return TRUE;
|
||||
@@ -1525,7 +1525,7 @@ $content .= "</li>\n";
|
||||
// var_export($this->model_class, TRUE)."\n";
|
||||
if ($this->authorization !== null)
|
||||
{
|
||||
$result = $this->authorization->allow ($this->module, $auth,
|
||||
$result = $this->authorization->allow ($this->module, $auth,
|
||||
"/".$this->model_class."/$id");
|
||||
// echo "RESULT=$result\n";
|
||||
if ($result === "RO") return TRUE;
|
||||
|
||||
30
users.php
30
users.php
@@ -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;
|
||||
|
||||
@@ -39,7 +39,7 @@ class userssql extends users
|
||||
$this->password = $password;
|
||||
$this->driver_options = $driver_options;
|
||||
}
|
||||
|
||||
|
||||
/** Connect to the storage */
|
||||
public function connect ()
|
||||
{
|
||||
@@ -75,7 +75,7 @@ class userssql extends users
|
||||
$this->db->tableprefix = $this->tableprefix;
|
||||
}
|
||||
|
||||
/** Initialise the storage
|
||||
/** Initialise the storage
|
||||
Create the structure of data needed to the class */
|
||||
public function initStorage ()
|
||||
{
|
||||
@@ -139,7 +139,7 @@ class userssql extends users
|
||||
$this->fieldLastname));
|
||||
}
|
||||
|
||||
/** 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)
|
||||
|
||||
Reference in New Issue
Block a user