Rename all the datas to data
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2512 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -150,7 +150,7 @@ class authentication
|
||||
// Login OK : save in SESSION and go to main page
|
||||
trigger_error ("Logging in for '$authparams->email'", E_USER_NOTICE);
|
||||
$session = new authsession ();
|
||||
$session-> savedatas ($authparams->email, $authparams->password,
|
||||
$session-> savedata ($authparams->email, $authparams->password,
|
||||
$res["lastname"], $res["firstname"]);
|
||||
if ($url === "")
|
||||
$this->route->redirect ("/", "");
|
||||
@@ -212,7 +212,7 @@ class authentication
|
||||
|
||||
/** Do the real authentication process on all the providers defined in the
|
||||
properties of the class.
|
||||
@return an array containing the user datas if the authentication is
|
||||
@return an array containing the user data if the authentication is
|
||||
correct,
|
||||
an exception if noting is found */
|
||||
private function verifAuth ($email, $password)
|
||||
|
||||
20
authldap.php
20
authldap.php
@@ -22,7 +22,7 @@ class authldap extends auth
|
||||
public $ldapfilter = "(mail=%s)";
|
||||
/** Field used to identify a user */
|
||||
public $ldapfield = "mail";
|
||||
/** Filter used to find the available datas of an authenticated user */
|
||||
/** Filter used to find the available data of an authenticated user */
|
||||
public $ldapfiltersearch = "(objectClass=inetOrgPerson)";
|
||||
|
||||
/** The opened LDAP connection identifier */
|
||||
@@ -83,13 +83,13 @@ class authldap extends auth
|
||||
$this->ldapfiltersearch);
|
||||
if ($search === FALSE)
|
||||
throw new Exception ("Can not found the details for user", 401);
|
||||
$datas = ldap_get_entries ($this->ldapconn, $search);
|
||||
$data = ldap_get_entries ($this->ldapconn, $search);
|
||||
$res = array ();
|
||||
if (isset ($datas[0]))
|
||||
if (isset ($data[0]))
|
||||
{
|
||||
$res = array ("lastname"=>$datas[0]["sn"][0],
|
||||
"firstname"=>$datas[0]["givenname"][0],
|
||||
"email"=>$datas[0]["mail"][0]);
|
||||
$res = array ("lastname"=>$data[0]["sn"][0],
|
||||
"firstname"=>$data[0]["givenname"][0],
|
||||
"email"=>$data[0]["mail"][0]);
|
||||
}
|
||||
|
||||
return $res;
|
||||
@@ -129,22 +129,22 @@ class authldap extends auth
|
||||
if ($search === FALSE)
|
||||
throw new Exception ("Unable to search the users in LDAP", 500);
|
||||
$info = ldap_get_entries ($this->ldapconn, $search);
|
||||
$datas = array ();
|
||||
$data = array ();
|
||||
foreach ($info as $key=>$vals)
|
||||
{
|
||||
if ($key === "count") continue;
|
||||
if (isset ($vals["sn"][0]) && isset ($vals["givenname"][0]) &&
|
||||
isset ($vals["mail"]))
|
||||
{
|
||||
$datas[$key] = array ("lastname"=>$vals["sn"][0],
|
||||
$data[$key] = array ("lastname"=>$vals["sn"][0],
|
||||
"firstname"=>$vals["givenname"][0],
|
||||
"email"=>$vals["mail"][0]);
|
||||
}
|
||||
|
||||
unset ($datas[$key]["mail"]["count"]);
|
||||
unset ($data[$key]["mail"]["count"]);
|
||||
}
|
||||
|
||||
return $datas;
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** Close the LDAP connection when closing the object or PHP */
|
||||
|
||||
@@ -69,8 +69,15 @@ class authsession extends auth
|
||||
405);
|
||||
}
|
||||
|
||||
/** Save the datas in session */
|
||||
/** Save the data in session
|
||||
@deprecated 0.23 */
|
||||
public function savedatas ($email, $password, $lastname, $firstname)
|
||||
{
|
||||
return $this->savedata ($email, $password, $lastname, $firstname);
|
||||
}
|
||||
|
||||
/** Save the data in session */
|
||||
public function savedata ($email, $password, $lastname, $firstname)
|
||||
{
|
||||
$_SESSION["domframework"]["auth"]["lastname"] = $lastname;
|
||||
$_SESSION["domframework"]["auth"]["firstname"] = $firstname;
|
||||
|
||||
@@ -314,7 +314,7 @@ class authzgroups
|
||||
$this->dbObject->disconnect ();
|
||||
}
|
||||
|
||||
/** Create the tables in the database to store the datas */
|
||||
/** Create the tables in the database to store the data */
|
||||
public function createTables ()
|
||||
{
|
||||
if ($this->dbObject == null)
|
||||
@@ -457,11 +457,11 @@ class authzgroups
|
||||
return $this->dbObject->titles;
|
||||
}
|
||||
|
||||
/** Check if the provided datas are compilant with the object specification
|
||||
@return array The errors found in the datas */
|
||||
public function objectVerify ($datas, $idobject=false)
|
||||
/** Check if the provided data are compilant with the object specification
|
||||
@return array The errors found in the data */
|
||||
public function objectVerify ($data, $idobject=false)
|
||||
{
|
||||
return $this->dbObject->verify ($datas, $idobject);
|
||||
return $this->dbObject->verify ($data, $idobject);
|
||||
}
|
||||
|
||||
////////////////
|
||||
@@ -564,11 +564,11 @@ class authzgroups
|
||||
return $this->dbGroup->titles;
|
||||
}
|
||||
|
||||
/** Check if the provided datas are compilant with the group specification
|
||||
@return array The errors found in the datas */
|
||||
public function groupVerify ($datas, $idgroup=false)
|
||||
/** Check if the provided data are compilant with the group specification
|
||||
@return array The errors found in the data */
|
||||
public function groupVerify ($data, $idgroup=false)
|
||||
{
|
||||
return $this->dbGroup->verify ($datas, $idgroup);
|
||||
return $this->dbGroup->verify ($data, $idgroup);
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
@@ -646,8 +646,8 @@ class authzgroups
|
||||
public function groupmemberUpdateByID ($module, $idgroup, $iduser, $user,
|
||||
$comment="")
|
||||
{
|
||||
$datas = $this->groupmemberReadUserDataByID ($module, $idgroup, $iduser);
|
||||
if (count ($datas) === 0)
|
||||
$data = $this->groupmemberReadUserDataByID ($module, $idgroup, $iduser);
|
||||
if (count ($data) === 0)
|
||||
throw new Exception (dgettext ("domframework",
|
||||
"IDUser in IDGroup not found"), 404);
|
||||
$this->rightCache = null;
|
||||
@@ -737,11 +737,11 @@ class authzgroups
|
||||
return $this->dbGroupMember->titles;
|
||||
}
|
||||
|
||||
/** Check if the provided datas are compilant with the group specification
|
||||
@return array The errors found in the datas */
|
||||
public function groupmembersVerify ($datas, $idgroupmember=false)
|
||||
/** Check if the provided data are compilant with the group specification
|
||||
@return array The errors found in the data */
|
||||
public function groupmembersVerify ($data, $idgroupmember=false)
|
||||
{
|
||||
return $this->dbGroupMember->verify ($datas, $idgroupmember);
|
||||
return $this->dbGroupMember->verify ($data, $idgroupmember);
|
||||
}
|
||||
|
||||
////////////////
|
||||
@@ -986,10 +986,10 @@ class authzgroups
|
||||
return array ("1"=>"RO", "2"=>"RW");
|
||||
}
|
||||
|
||||
/** Check if the provided datas are compilant with the group specification
|
||||
@return array The errors found in the datas */
|
||||
public function rightVerify ($datas, $idright=false)
|
||||
/** Check if the provided data are compilant with the group specification
|
||||
@return array The errors found in the data */
|
||||
public function rightVerify ($data, $idright=false)
|
||||
{
|
||||
return $this->dbRight->verify ($datas, $idright);
|
||||
return $this->dbRight->verify ($data, $idright);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,40 +27,40 @@ class cachefile
|
||||
$res = false;
|
||||
if (file_exists ($fileCache))
|
||||
{
|
||||
$datas = file_get_contents ($fileCache);
|
||||
$datas = unserialize ($datas);
|
||||
if (($datas["createTime"] + $datas["ttl"]) >= time ())
|
||||
$data = file_get_contents ($fileCache);
|
||||
$data = unserialize ($data);
|
||||
if (($data["createTime"] + $data["ttl"]) >= time ())
|
||||
{
|
||||
$res = $datas["data"];
|
||||
$res = $data["data"];
|
||||
}
|
||||
}
|
||||
|
||||
if ($res === false)
|
||||
{
|
||||
$datas = array ("ttl"=>24*60*60,
|
||||
"createTime"=>time(),
|
||||
"data"=>"CACHE-Garbage");
|
||||
file_put_contents ($fileCache, serialize ($datas));
|
||||
$data = array ("ttl"=>24*60*60,
|
||||
"createTime"=>time(),
|
||||
"data"=>"CACHE-Garbage");
|
||||
file_put_contents ($fileCache, serialize ($data));
|
||||
chmod ($fileCache, 0666);
|
||||
$files = glob ($this->directory."/*", GLOB_NOSORT);
|
||||
foreach ($files as $fileCache)
|
||||
{
|
||||
$datas = file_get_contents ($fileCache);
|
||||
if ($datas === false)
|
||||
$data = file_get_contents ($fileCache);
|
||||
if ($data === false)
|
||||
{
|
||||
unlink ($fileCache);
|
||||
continue;
|
||||
}
|
||||
|
||||
$datas = unserialize ($datas);
|
||||
if (! isset ($datas["ttl"]) || ! isset ($datas["data"]) ||
|
||||
! isset ($datas["createTime"]))
|
||||
$data = unserialize ($data);
|
||||
if (! isset ($data["ttl"]) || ! isset ($data["data"]) ||
|
||||
! isset ($data["createTime"]))
|
||||
{
|
||||
unlink ($fileCache);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (($datas["createTime"] + $datas["ttl"]) <= time ())
|
||||
if (($data["createTime"] + $data["ttl"]) <= time ())
|
||||
{
|
||||
unlink ($fileCache);
|
||||
}
|
||||
@@ -129,10 +129,10 @@ class cachefile
|
||||
$this->garbage ();
|
||||
$fileCache = $this->directory."/".sha1 ($id);
|
||||
touch ($fileCache.".lock");
|
||||
$datas = array ("ttl"=>$ttl,
|
||||
$data = array ("ttl"=>$ttl,
|
||||
"createTime"=>time(),
|
||||
"data"=>$data);
|
||||
file_put_contents ($fileCache, serialize ($datas));
|
||||
file_put_contents ($fileCache, serialize ($data));
|
||||
unlink ($fileCache.".lock");
|
||||
chmod ($fileCache, 0666);
|
||||
return true;
|
||||
@@ -174,31 +174,31 @@ class cachefile
|
||||
usleep (100000);
|
||||
}
|
||||
|
||||
// The lock is pending 10s (stale) : removing it to read the datas quicker
|
||||
// The lock is pending 10s (stale) : removing it to read the data quicker
|
||||
// next time
|
||||
if (file_exists ($fileCache.".lock"))
|
||||
unlink ($fileCache.".lock");
|
||||
|
||||
$datas = file_get_contents ($fileCache);
|
||||
if ($datas === false)
|
||||
$data = file_get_contents ($fileCache);
|
||||
if ($data === false)
|
||||
{
|
||||
unlink ($fileCache);
|
||||
return false;
|
||||
}
|
||||
|
||||
$datas = unserialize ($datas);
|
||||
if (! isset ($datas["ttl"]) || ! isset ($datas["data"]) ||
|
||||
! isset ($datas["createTime"]))
|
||||
$data = unserialize ($data);
|
||||
if (! isset ($data["ttl"]) || ! isset ($data["data"]) ||
|
||||
! isset ($data["createTime"]))
|
||||
{
|
||||
unlink ($fileCache);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($datas["createTime"] + $datas["ttl"]) >= time ())
|
||||
if (($data["createTime"] + $data["ttl"]) >= time ())
|
||||
{
|
||||
if (file_exists ($fileCache.".lock"))
|
||||
unlink ($fileCache.".lock");
|
||||
return $datas["data"];
|
||||
return $data["data"];
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -49,20 +49,20 @@ class cacheoutput
|
||||
|
||||
ob_start ();
|
||||
$this->saving = true;
|
||||
// The datas are sent automatically
|
||||
// The data are sent automatically
|
||||
}
|
||||
|
||||
/** End of saving the datas in cache */
|
||||
/** End of saving the data in cache */
|
||||
public function __destruct ()
|
||||
{
|
||||
// Force the path because it return to / in the destructor
|
||||
chdir ($this->cacheCWD);
|
||||
if ($this->saving === true)
|
||||
{
|
||||
// Do the saving of the datas
|
||||
$datas = array ("content"=>ob_get_contents (),
|
||||
// Do the saving of the data
|
||||
$data = array ("content"=>ob_get_contents (),
|
||||
"headers"=>headers_list ());
|
||||
$this->cache->write ($this->id, $datas, $this->ttl);
|
||||
$this->cache->write ($this->id, $data, $this->ttl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class dblayerauthzgroups extends dblayer
|
||||
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 datas */
|
||||
@return the modified data */
|
||||
public function hookpreinsert ($data)
|
||||
{
|
||||
if ($this->module === null)
|
||||
@@ -171,7 +171,7 @@ class dblayerauthzgroups extends dblayer
|
||||
/** Hook preupdate
|
||||
This hook is run before updating a data in the database, after the
|
||||
verification
|
||||
@return the modified datas */
|
||||
@return the modified data */
|
||||
public function hookpreupdate ($updatekey, $data)
|
||||
{
|
||||
if ($this->module === null)
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
@package domframework
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
/** Class used to display datas */
|
||||
/** Class used to display data */
|
||||
class output
|
||||
{
|
||||
/** Class used to display datas
|
||||
/** Class used to display data
|
||||
@param mixed $data The data to be displayed */
|
||||
public function out ($data)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
require_once ("output.php");
|
||||
/** Display in CSV the datas provided */
|
||||
/** Display in CSV the data provided */
|
||||
class outputcsv extends output
|
||||
{
|
||||
/** Don't allow to output in CSV if the functions are not available in PHP */
|
||||
@@ -14,7 +14,7 @@ class outputcsv extends output
|
||||
throw new Exception ("CSV support not available in PHP !", 500);
|
||||
}
|
||||
|
||||
/** Display in CSV the datas provided
|
||||
/** Display in CSV the data provided
|
||||
@param mixed $data The data to be displayed */
|
||||
public function out ($data)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
require_once ("output.php");
|
||||
/** Display in HTML the datas provided, with the layout support */
|
||||
/** Display in HTML the data provided, with the layout support */
|
||||
class outputhtml extends output
|
||||
{
|
||||
/** Data is printed by viewClass->viewmethod, in the middle of $layout
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
require_once ("output.php");
|
||||
/** Display in JSOn the datas provided */
|
||||
/** Display in JSOn the data provided */
|
||||
class outputjson extends output
|
||||
{
|
||||
/** Don't allow to output in JSON if the functions are not available in PHP */
|
||||
@@ -15,7 +15,7 @@ class outputjson extends output
|
||||
"install php5-json", 500);
|
||||
}
|
||||
|
||||
/** Display in JSOn the datas provided
|
||||
/** Display in JSOn the data provided
|
||||
@param mixed $data The data to be displayed */
|
||||
public function out ($data)
|
||||
{
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
require_once ("output.php");
|
||||
/** Display in Text the datas provided */
|
||||
/** Display in Text the data provided */
|
||||
class outputtxt extends output
|
||||
{
|
||||
/** Display an array on table format (TRUE) or tree format (FALSE) */
|
||||
public $table = TRUE;
|
||||
|
||||
/** Display in Text the datas provided
|
||||
/** Display in Text the data provided
|
||||
@param mixed $data The data to be displayed */
|
||||
public function out ($data)
|
||||
{
|
||||
@@ -100,7 +100,7 @@ class outputtxt extends output
|
||||
echo " |\n";
|
||||
echo "$border";
|
||||
|
||||
// Display datas
|
||||
// Display data
|
||||
foreach ($data as $line)
|
||||
{
|
||||
echo "| ";
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
require_once ("output.php");
|
||||
/** Display in XML the datas provided */
|
||||
/** Display in XML the data provided */
|
||||
class outputxml extends output
|
||||
{
|
||||
/** Display in XML the datas provided
|
||||
/** Display in XML the data provided
|
||||
@param mixed $data The data to be displayed */
|
||||
public function out ($data)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@package domframework
|
||||
@author Dominique Fournier <dominique@fournier38.fr> */
|
||||
|
||||
/** Display the datas in HTML with a FLASH method to display the errors */
|
||||
/** Display the data in HTML with a FLASH method to display the errors */
|
||||
class renderer
|
||||
{
|
||||
/** The result in construction */
|
||||
|
||||
18
routeSQL.php
18
routeSQL.php
@@ -10,7 +10,7 @@ require_once ("domframework/renderer.php");
|
||||
error_reporting (E_ALL);
|
||||
|
||||
/** Automatic Routing for SQL database
|
||||
Allow to do CRUD on datas with only one line in index.php */
|
||||
Allow to do CRUD on data with only one line in index.php */
|
||||
class routeSQL
|
||||
{
|
||||
/** Activate the debug */
|
||||
@@ -1133,8 +1133,8 @@ $content .= "</li>\n";
|
||||
}
|
||||
|
||||
$field = new formfield ("submit", dgettext("domframework",
|
||||
"Save the datas"));
|
||||
$field->defaults = dgettext("domframework","Save the datas");
|
||||
"Save the data"));
|
||||
$field->defaults = dgettext("domframework","Save the data");
|
||||
$field->type = "submit";
|
||||
$fields[] = $field;
|
||||
unset ($field);
|
||||
@@ -1145,7 +1145,7 @@ $content .= "</li>\n";
|
||||
|
||||
$route->post ($this->url_prefix."/add", function ($chain=null) use ($route)
|
||||
{
|
||||
// Add a new entry : effective save of the datas
|
||||
// Add a new entry : effective save of the data
|
||||
if ($this->chained !== null)
|
||||
{
|
||||
if ($this->chained->editright ($this->authHTML["email"], $chain) !==
|
||||
@@ -1379,8 +1379,8 @@ $content .= "</li>\n";
|
||||
if ($readonly === false && $this->readwriteAllowed === true)
|
||||
{
|
||||
$field = new formfield ("submit", dgettext("domframework",
|
||||
"Save the datas"));
|
||||
$field->defaults = dgettext("domframework","Save the datas");
|
||||
"Save the data"));
|
||||
$field->defaults = dgettext("domframework","Save the data");
|
||||
$field->type = "submit";
|
||||
$fields[] = $field;
|
||||
unset ($field);
|
||||
@@ -1482,7 +1482,7 @@ $content .= "</li>\n";
|
||||
});
|
||||
}
|
||||
|
||||
/** Authorization : Return TRUE if the user right allow to see the datas
|
||||
/** Authorization : Return TRUE if the user right allow to see the data
|
||||
Return FALSE else */
|
||||
public function accessright ($auth, $id=null)
|
||||
{
|
||||
@@ -1500,7 +1500,7 @@ $content .= "</li>\n";
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/** Authorization : Return TRUE if the user right allow to edit the datas
|
||||
/** Authorization : Return TRUE if the user right allow to edit the data
|
||||
Return FALSE else */
|
||||
public function editright ($auth, $id=null)
|
||||
{
|
||||
@@ -1534,7 +1534,7 @@ $content .= "</li>\n";
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/** Return the datas of the row if the $id exists in the primary key of the
|
||||
/** Return the data of the row if the $id exists in the primary key of the
|
||||
table
|
||||
Return FALSE in the other cases */
|
||||
public function keyexists ($id)
|
||||
|
||||
Reference in New Issue
Block a user