summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-04 03:02:01 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-05-04 03:02:01 +0300
commit63f714d5a78b765c117ebf6bbdfdbd748dd45644 (patch)
tree87a4db40e1ff699222ccfdf699a3904d1c665bfc /core
parent931a93cd7bae092e2752064568cebe407d2bf46e (diff)
downloadgyraf1gov-63f714d5a78b765c117ebf6bbdfdbd748dd45644.tar.gz
gyraf1gov-63f714d5a78b765c117ebf6bbdfdbd748dd45644.tar.bz2
gyraf1gov-63f714d5a78b765c117ebf6bbdfdbd748dd45644.zip
authentication; invitation; activation; base form setup
Diffstat (limited to 'core')
-rw-r--r--core/classes/Database.php24
-rw-r--r--core/classes/authentication/User.php3
-rw-r--r--core/classes/session/DefaultSession.php1
-rw-r--r--core/config/anom_settings.php2
4 files changed, 25 insertions, 5 deletions
diff --git a/core/classes/Database.php b/core/classes/Database.php
index 8cac479..0a8a10a 100644
--- a/core/classes/Database.php
+++ b/core/classes/Database.php
@@ -14,6 +14,8 @@ class Database {
private $result = null;
+ private $rowCount;
+
/** METHODS
* -------------------------------------------------------------------------
@@ -78,6 +80,25 @@ class Database {
}
+
+ /** rowCount
+ *
+ * returns the number of affected rows from the last modification query
+ * (that inludes any of INSERT, UPDATE or DELETE; not the SELECT ones)
+ *
+ * NOTE:
+ * originally in php PDO driver, rowCount is applied onto the stamement;
+ * here it is applied onto the actual object, making the call much easier
+ *
+ * @param void;
+ * @return (int) : number of affected rows
+ */
+ public function rowCount()
+ {
+ return $this->rowCount;
+ }
+
+
/** query
* ---
* set and execute a query safely;
@@ -103,6 +124,9 @@ class Database {
}
+ // keep rowCount (valid for INSERT, UPDATE, DELETE)
+ $this->rowCount = $stmt->rowCount();
+
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
$this->result = $result;
diff --git a/core/classes/authentication/User.php b/core/classes/authentication/User.php
index babc7fd..f6508ff 100644
--- a/core/classes/authentication/User.php
+++ b/core/classes/authentication/User.php
@@ -20,9 +20,6 @@ class User implements UserInterface
// @var array
private $roles = [];
- // @var array
- private $privileges = [];
-
// @var bool
private $enabled = true;
diff --git a/core/classes/session/DefaultSession.php b/core/classes/session/DefaultSession.php
index 079ab9d..819f00a 100644
--- a/core/classes/session/DefaultSession.php
+++ b/core/classes/session/DefaultSession.php
@@ -15,6 +15,7 @@ class DefaultSession implements SessionHandlerInterface {
// (the default way)
// and let the session* functions
// do what they know
+ ini_set( "session.gc_maxlifetime", MAX_SESSION_LIFE );
session_name(SESSION_NAME);
session_start();
}
diff --git a/core/config/anom_settings.php b/core/config/anom_settings.php
index 50056bf..6713771 100644
--- a/core/config/anom_settings.php
+++ b/core/config/anom_settings.php
@@ -41,8 +41,6 @@ define('APP_NAME', 'e-Classroom'); // Application Name
define('APP_VERSION', 'v0.2'); // Application version
-define('SESSION_NAME', 'clroom'); // Session Name
-
/** APPLICATION PATHS ///////////////////////////////////////////////////////////