aboutsummaryrefslogtreecommitdiff
path: root/app/class/user.php
diff options
context:
space:
mode:
authorvincent-peugnet <v.peugnet@free.fr>2019-01-22 02:04:53 +0100
committervincent-peugnet <v.peugnet@free.fr>2019-01-22 02:04:53 +0100
commit695908c7ab2a5d5f011f616d2af3368da7131a6f (patch)
treecbd6c2a43495e77863d3611e2f6b12985b1111d8 /app/class/user.php
parenta8ed9070e7773f3147a33dbee7d45ce24bd8959d (diff)
downloadwcms-695908c7ab2a5d5f011f616d2af3368da7131a6f.tar.gz
wcms-695908c7ab2a5d5f011f616d2af3368da7131a6f.zip
home columns and download function added
Diffstat (limited to 'app/class/user.php')
-rw-r--r--app/class/user.php38
1 files changed, 36 insertions, 2 deletions
diff --git a/app/class/user.php b/app/class/user.php
index 9bfc071..2e451a9 100644
--- a/app/class/user.php
+++ b/app/class/user.php
@@ -7,6 +7,8 @@ class User
protected $signature = '';
protected $password;
protected $passwordhashed = false;
+ protected $cookie = 0;
+ protected $columns = ['title', 'datemodif', 'datecreation', 'secure', 'visitcount'];
public function __construct($datas = [])
{
@@ -35,6 +37,9 @@ class User
return $array;
}
+
+ // _________________________ G E T _______________________
+
public function id()
{
return $this->id;
@@ -64,6 +69,20 @@ class User
return $this->passwordhashed;
}
+ public function cookie()
+ {
+ return $this->cookie;
+ }
+
+ public function columns()
+ {
+ return $this->columns;
+ }
+
+
+
+ // _______________________ S E T _______________________
+
public function setid($id)
{
$id = idclean($id);
@@ -80,9 +99,9 @@ class User
}
}
- public function setpassword(string $password)
+ public function setpassword($password)
{
- if (is_string($password) && !empty($password)) {
+ if (!empty($password) && is_string($password)) {
$this->password = $password;
}
@@ -101,6 +120,21 @@ class User
}
+ public function setcookie($cookie)
+ {
+ $cookie = abs(intval($cookie));
+ if($cookie >= 365) {$cookie = 365;}
+ $this->cookie = $cookie;
+ }
+
+ public function setcolumns($columns)
+ {
+ if(is_array($columns)) {
+ $columns = array_filter(array_intersect(array_unique($columns), Model::COLUMNS));
+ $this->columns = $columns;
+ }
+ }
+