diff --git a/auth.php b/auth.php index 5a18701..7f7e2f5 100644 --- a/auth.php +++ b/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 .= "
$content\n";
return "$content\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)
diff --git a/module.php b/module.php
index 9c7d3c8..5ae10e9 100644
--- a/module.php
+++ b/module.php
@@ -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;
diff --git a/outputhtml.php b/outputhtml.php
index b2234ba..beae32c 100644
--- a/outputhtml.php
+++ b/outputhtml.php
@@ -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;
diff --git a/ratelimit.php b/ratelimit.php
index 1d1575b..d8fe826 100644
--- a/ratelimit.php
+++ b/ratelimit.php
@@ -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)
diff --git a/ratelimitfile.php b/ratelimitfile.php
index efd57e9..28364e6 100644
--- a/ratelimitfile.php
+++ b/ratelimitfile.php
@@ -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)
diff --git a/renderer.php b/renderer.php
index 6695ffe..0c9b2e0 100644
--- a/renderer.php
+++ b/renderer.php
@@ -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));
diff --git a/route.php b/route.php
index af7e9ae..d0189de 100644
--- a/route.php
+++ b/route.php
@@ -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"],
diff --git a/routeSQL.php b/routeSQL.php
index cd972b6..65b4dfe 100644
--- a/routeSQL.php
+++ b/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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\n";
}
- $content = "";
+ $content = "";
// Internal CSS
if ($this->enableInternalCSS === true)
{
@@ -984,7 +984,7 @@ $content .= "\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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\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 .= "\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;
diff --git a/users.php b/users.php
index 178ed1a..e3105d9 100644
--- a/users.php
+++ b/users.php
@@ -1,5 +1,5 @@
= 128)
- throw new Exception (dgettext("domframework",
+ throw new Exception (dgettext("domframework",
"Invalid password provided : too long"),
500);
return true;
diff --git a/userssql.php b/userssql.php
index c56dbd8..6f8d45d 100644
--- a/userssql.php
+++ b/userssql.php
@@ -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)