diff --git a/.gitmodules b/.gitmodules
index 76eac3b..13a18d0 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -10,6 +10,9 @@
[submodule "lib/tinymce"]
path = lib/tinymce
url = git@mojotrollz.eu:webcraft/lib_tinymce.git
+[submodule "lib/bootstrap_growl"]
+ path = lib/bootstrap_growl
+ url = git@mojotrollz.eu:webcraft/lib_bootstrap-growl.git
[submodule "lib/textillate"]
path = lib/textillate
url = git@mojotrollz.eu:webcraft/lib_textillate.git
@@ -22,3 +25,6 @@
[submodule "lib/tablesorter"]
path = lib/tablesorter
url = git@mojotrollz.eu:webcraft/lib_tablesorter.git
+[submodule "lib/git"]
+ path = lib/git
+ url = git@mojotrollz.eu:webcraft/lib_git.git
diff --git a/autoload.inc b/autoload.inc
index 9682377..b9327a7 100644
--- a/autoload.inc
+++ b/autoload.inc
@@ -20,5 +20,4 @@ require_once dirname(__FILE__).'/docu/autoload.inc';
require_once dirname(__FILE__).'/files/autoload.inc';
require_once dirname(__FILE__).'/cron/autoload.inc';
require_once dirname(__FILE__).'/sai/autoload.inc';
-require_once dirname(__FILE__).'/lib/autoload.inc';
-require_once dirname(__FILE__).'/git/autoload.inc';
\ No newline at end of file
+require_once dirname(__FILE__).'/lib/autoload.inc';
\ No newline at end of file
diff --git a/cron/cron_log2sqlite.php b/cron/cron_log2sqlite.php
index f963ea3..3ebd42f 100644
--- a/cron/cron_log2sqlite.php
+++ b/cron/cron_log2sqlite.php
@@ -9,6 +9,9 @@ class cron_log2sqlite extends \SYSTEM\CRON\cronjob{
if( $oldest['year'] >= $now_year &&
$oldest['month'] >= $now_month){
return cronstatus::CRON_STATUS_SUCCESFULLY;}
+ //create folder if required
+ if (!file_exists(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH))) {
+ mkdir(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH), 0777, true);}
$filename = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CRON_LOG2SQLITE_PATH).$oldest['year'].'.'.$oldest['month'].'.db';
//extract whole month to file
$con = new \SYSTEM\DB\Connection(new \SYSTEM\DB\DBInfoSQLite($filename));
diff --git a/db/qq/QP.php b/db/qq/QP.php
index 534b5d7..0ddb97f 100644
--- a/db/qq/QP.php
+++ b/db/qq/QP.php
@@ -1,35 +1,38 @@
dbinfo);
- $is_pg = \SYSTEM\system::isSystemDbInfoPG();
- if($query->dbinfo){
- $is_pg = $query->dbinfo instanceof \SYSTEM\DB\DBInfoPG;}
- if($is_pg){
- return $con->prepare($query->name,$query->sql_pg,$params);
- } else {
- return $con->prepare($query->name,$query->sql_mys,$params_mys ? $params_mys : $params);}
+class QP {
+ public static function QQ($params,$dbinfo = null){
+ if(!$dbinfo){
+ $dbinfo = \SYSTEM\system::getSystemDBInfo();}
+ $con = new \SYSTEM\DB\Connection($dbinfo);
+ try{
+ if($dbinfo instanceof \SYSTEM\DB\DBInfoPG){
+ return $con->prepare(static::get_class(),static::pgsql(),$params);
+ } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoMYS){
+ return $con->prepare(static::get_class(),static::mysql(),$params);
+ } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoAMQP){
+ return $con->prepare(static::get_class(),static::amqp(),$params);
+ } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoSQLite){
+ return $con->prepare(static::get_class(),static::sqlite(),$params);
+ }
+ } catch (\Exception $e){
+ throw new \SYSTEM\LOG\ERROR(static::get_class().' failed causing: '.$e->getMessage(),$e->getCode(),$e);}
+ throw new \Exception('Could not understand Database Settings. Check ur Database Settings');
}
- public static function QA($params,$params_mys = null){
- $res = self::QQ($params,$params_mys);
+ public static function QA($params,$dbinfo = null){
+ $res = self::QQ($params,$dbinfo);
$result = array();
while($row = $res->next()){
$result[] = $row;}
return $result;
}
- public static function Q1($params,$params_mys = null){
- return self::QQ($params,$params_mys)->next();}
+ public static function Q1($params,$dbinfo = null){
+ return self::QQ($params,$dbinfo)->next();}
- public static function QI($params,$params_mys = null){
- $qq = self::QQ($params,$params_mys);
- return $qq->affectedRows() != (0||null);}
- //override this
- protected static function query(){
- throw new \SYSTEM\LOG\ERROR('query function of your QP Class not overwritten!');}
- //return new QQuery();}
+ public static function QI($params,$dbinfo = null){
+ $qq = self::QQ($params,$dbinfo);
+ return $qq->affectedRows() != (0||null);}
}
\ No newline at end of file
diff --git a/db/qq/QQ.php b/db/qq/QQ.php
index ab86314..d8b3de7 100644
--- a/db/qq/QQ.php
+++ b/db/qq/QQ.php
@@ -2,33 +2,37 @@
namespace SYSTEM\DB;
class QQ {
- public static function QQ(){
- $query = static::query();
- $con = new \SYSTEM\DB\Connection($query->dbinfo);
- $is_pg = \SYSTEM\system::isSystemDbInfoPG();
- if($query->dbinfo){
- $is_pg = $query->dbinfo instanceof \SYSTEM\DB\DBInfoPG;}
- if($is_pg){
- return $con->query($query->sql_pg);
- } else {
- return $con->query($query->sql_mys);}
+ public static function QQ($dbinfo = null){
+ if(!$dbinfo){
+ $dbinfo = \SYSTEM\system::getSystemDBInfo();}
+ $con = new \SYSTEM\DB\Connection($dbinfo);
+
+ try{
+ if($dbinfo instanceof \SYSTEM\DB\DBInfoPG){
+ return $con->query(static::pgsql());
+ } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoMYS){
+ return $con->query(static::mysql());
+ } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoAMQP){
+ return $con->query(static::amqp());
+ } else if ($dbinfo instanceof \SYSTEM\DB\DBInfoSQLite){
+ return $con->query(static::sqlite());
+ }
+ } catch (\Exception $e){
+ throw new \SYSTEM\LOG\ERROR(static::get_class().' failed causing: '.$e->getMessage(),$e->getCode(),$e);}
+
+ throw new \Exception('Could not understand Database Settings. Check ur Database Settings');
}
- public static function QA(){
- $res = self::QQ();
+ public static function QA($dbinfo = null){
+ $res = self::QQ($dbinfo);
$result = array();
while($row = $res->next()){
$result[] = $row;}
return $result;
}
- public static function Q1(){
- return self::QQ()->next();}
- public static function QI(){
- $qq = self::QQ();
- return $qq;}
- //override this
- protected static function query(){
- throw new \SYSTEM\LOG\ERROR('query function of your QQ Class not overwritten!');}
- //return new QQuery();}
+ public static function Q1($dbinfo = null){
+ return self::QQ($dbinfo)->next();}
+ public static function QI($dbinfo = null){
+ return self::QQ($dbinfo);}
}
\ No newline at end of file
diff --git a/db/qq/QQuery.php b/db/qq/QQuery.php
deleted file mode 100644
index 3b7a306..0000000
--- a/db/qq/QQuery.php
+++ /dev/null
@@ -1,16 +0,0 @@
-name = $name;
- $this->sql_pg = $sql_pg;
- $this->sql_mys = $sql_mys;
- $this->dbinfo = $dbinfo;
- }
-}
diff --git a/dbd/qq/SYS_API_TREE.php b/dbd/qq/SYS_API_TREE.php
index e77d418..f0aa452 100644
--- a/dbd/qq/SYS_API_TREE.php
+++ b/dbd/qq/SYS_API_TREE.php
@@ -1,15 +1,15 @@
clone_remote($source, $reference);
- } else {
- $repo->clone_from($source);
- }
- } else {
- $repo->run('init');
- }
- return $repo;
- }
- }
-
- /**
- * Constructor
- *
- * Accepts a repository path
- *
- * @access public
- * @param string repository path
- * @param bool create if not exists?
- * @return void
- */
- public function __construct($repo_path = null, $create_new = false, $_init = true) {
- if (is_string($repo_path)) {
- $this->set_repo_path($repo_path, $create_new, $_init);
- }
- }
-
- /**
- * Set the repository's path
- *
- * Accepts the repository path
- *
- * @access public
- * @param string repository path
- * @param bool create if not exists?
- * @param bool initialize new Git repo if not exists?
- * @return void
- */
- public function set_repo_path($repo_path, $create_new = false, $_init = true) {
- if (is_string($repo_path)) {
- if ($new_path = realpath($repo_path)) {
- $repo_path = $new_path;
- if (is_dir($repo_path)) {
- // Is this a work tree?
- if (file_exists($repo_path."/.git") && is_dir($repo_path."/.git")) {
- $this->repo_path = $repo_path;
- $this->bare = false;
- // Is this a bare repo?
- } else if (is_file($repo_path."/config")) {
- $parse_ini = parse_ini_file($repo_path."/config");
- if ($parse_ini['bare']) {
- $this->repo_path = $repo_path;
- $this->bare = true;
- }
- } else {
- if ($create_new) {
- $this->repo_path = $repo_path;
- if ($_init) {
- $this->run('init');
- }
- } else {
- throw new \Exception('"'.$repo_path.'" is not a git repository');
- }
- }
- } else {
- throw new \Exception('"'.$repo_path.'" is not a directory');
- }
- } else {
- if ($create_new) {
- if ($parent = realpath(dirname($repo_path))) {
- mkdir($repo_path);
- $this->repo_path = $repo_path;
- if ($_init) $this->run('init');
- } else {
- throw new \Exception('cannot create repository in non-existent directory');
- }
- } else {
- throw new \Exception('"'.$repo_path.'" does not exist');
- }
- }
- }
- }
-
- /**
- * Get the path to the git repo directory (eg. the ".git" directory)
- *
- * @access public
- * @return string
- */
- public function git_directory_path() {
- return ($this->bare) ? $this->repo_path : $this->repo_path."/.git";
- }
-
- /**
- * Tests if git is installed
- *
- * @access public
- * @return bool
- */
- public function test_git() {
- $descriptorspec = array(
- 1 => array('pipe', 'w'),
- 2 => array('pipe', 'w'),
- );
- $pipes = array();
- $resource = proc_open(Git::get_bin(), $descriptorspec, $pipes);
-
- $stdout = stream_get_contents($pipes[1]);
- $stderr = stream_get_contents($pipes[2]);
- foreach ($pipes as $pipe) {
- fclose($pipe);
- }
-
- $status = trim(proc_close($resource));
- return ($status != 127);
- }
-
- /**
- * Run a command in the git repository
- *
- * Accepts a shell command to run
- *
- * @access protected
- * @param string command to run
- * @return string
- */
- protected function run_command($command) {
- $descriptorspec = array(
- 1 => array('pipe', 'w'),
- 2 => array('pipe', 'w'),
- );
- $pipes = array();
- /* Depending on the value of variables_order, $_ENV may be empty.
- * In that case, we have to explicitly set the new variables with
- * putenv, and call proc_open with env=null to inherit the reset
- * of the system.
- *
- * This is kind of crappy because we cannot easily restore just those
- * variables afterwards.
- *
- * If $_ENV is not empty, then we can just copy it and be done with it.
- */
- if(count($_ENV) === 0) {
- $env = NULL;
- foreach($this->envopts as $k => $v) {
- putenv(sprintf("%s=%s",$k,$v));
- }
- } else {
- $env = array_merge($_ENV, $this->envopts);
- }
- $cwd = $this->repo_path;
- $resource = proc_open($command, $descriptorspec, $pipes, $cwd, $env);
-
- $stdout = stream_get_contents($pipes[1]);
- $stderr = stream_get_contents($pipes[2]);
- foreach ($pipes as $pipe) {
- fclose($pipe);
- }
-
- $status = trim(proc_close($resource));
- if ($status) throw new \Exception($stderr);
-
- return $stdout;
- }
-
- /**
- * Run a git command in the git repository
- *
- * Accepts a git command to run
- *
- * @access public
- * @param string command to run
- * @return string
- */
- public function run($command) {
- return $this->run_command(Git::get_bin()." ".$command);
- }
-
- /**
- * Runs a 'git status' call
- *
- * Accept a convert to HTML bool
- *
- * @access public
- * @param bool return string with
- * @return string
- */
- public function status($html = false) {
- $msg = $this->run("status");
- if ($html == true) {
- $msg = str_replace("\n", " ", $msg);
- }
- return $msg;
- }
-
- /**
- * Runs a `git add` call
- *
- * Accepts a list of files to add
- *
- * @access public
- * @param mixed files to add
- * @return string
- */
- public function add($files = "*") {
- if (is_array($files)) {
- $files = '"'.implode('" "', $files).'"';
- }
- return $this->run("add $files -v");
- }
-
- /**
- * Runs a `git rm` call
- *
- * Accepts a list of files to remove
- *
- * @access public
- * @param mixed files to remove
- * @param Boolean use the --cached flag?
- * @return string
- */
- public function rm($files = "*", $cached = false) {
- if (is_array($files)) {
- $files = '"'.implode('" "', $files).'"';
- }
- return $this->run("rm ".($cached ? '--cached ' : '').$files);
- }
-
-
- /**
- * Runs a `git commit` call
- *
- * Accepts a commit message string
- *
- * @access public
- * @param string commit message
- * @param boolean should all files be committed automatically (-a flag)
- * @return string
- */
- public function commit($message = "", $commit_all = true) {
- $flags = $commit_all ? '-av' : '-v';
- return $this->run("commit ".$flags." -m ".escapeshellarg($message));
- }
-
- /**
- * Runs a `git clone` call to clone the current repository
- * into a different directory
- *
- * Accepts a target directory
- *
- * @access public
- * @param string target directory
- * @return string
- */
- public function clone_to($target) {
- return $this->run("clone --local ".$this->repo_path." $target");
- }
-
- /**
- * Runs a `git clone` call to clone a different repository
- * into the current repository
- *
- * Accepts a source directory
- *
- * @access public
- * @param string source directory
- * @return string
- */
- public function clone_from($source) {
- return $this->run("clone --local $source ".$this->repo_path);
- }
-
- /**
- * Runs a `git clone` call to clone a remote repository
- * into the current repository
- *
- * Accepts a source url
- *
- * @access public
- * @param string source url
- * @param string reference path
- * @return string
- */
- public function clone_remote($source, $reference) {
- return $this->run("clone $reference $source ".$this->repo_path);
- }
-
- /**
- * Runs a `git clean` call
- *
- * Accepts a remove directories flag
- *
- * @access public
- * @param bool delete directories?
- * @param bool force clean?
- * @return string
- */
- public function clean($dirs = false, $force = false) {
- return $this->run("clean".(($force) ? " -f" : "").(($dirs) ? " -d" : ""));
- }
-
- /**
- * Runs a `git branch` call
- *
- * Accepts a name for the branch
- *
- * @access public
- * @param string branch name
- * @return string
- */
- public function create_branch($branch) {
- return $this->run("branch $branch");
- }
-
- /**
- * Runs a `git branch -[d|D]` call
- *
- * Accepts a name for the branch
- *
- * @access public
- * @param string branch name
- * @return string
- */
- public function delete_branch($branch, $force = false) {
- return $this->run("branch ".(($force) ? '-D' : '-d')." $branch");
- }
-
- /**
- * Runs a `git branch` call
- *
- * @access public
- * @param bool keep asterisk mark on active branch
- * @return array
- */
- public function list_branches($keep_asterisk = false) {
- $branchArray = explode("\n", $this->run("branch"));
- foreach($branchArray as $i => &$branch) {
- $branch = trim($branch);
- if (! $keep_asterisk) {
- $branch = str_replace("* ", "", $branch);
- }
- if ($branch == "") {
- unset($branchArray[$i]);
- }
- }
- return $branchArray;
- }
-
- /**
- * Lists remote branches (using `git branch -r`).
- *
- * Also strips out the HEAD reference (e.g. "origin/HEAD -> origin/master").
- *
- * @access public
- * @return array
- */
- public function list_remote_branches() {
- $branchArray = explode("\n", $this->run("branch -r"));
- foreach($branchArray as $i => &$branch) {
- $branch = trim($branch);
- if ($branch == "" || strpos($branch, 'HEAD -> ') !== false) {
- unset($branchArray[$i]);
- }
- }
- return $branchArray;
- }
-
- /**
- * Returns name of active branch
- *
- * @access public
- * @param bool keep asterisk mark on branch name
- * @return string
- */
- public function active_branch($keep_asterisk = false) {
- $branchArray = $this->list_branches(true);
- $active_branch = preg_grep("/^\*/", $branchArray);
- reset($active_branch);
- if ($keep_asterisk) {
- return current($active_branch);
- } else {
- return str_replace("* ", "", current($active_branch));
- }
- }
-
- /**
- * Runs a `git checkout` call
- *
- * Accepts a name for the branch
- *
- * @access public
- * @param string branch name
- * @return string
- */
- public function checkout($branch) {
- return $this->run("checkout $branch");
- }
-
-
- /**
- * Runs a `git merge` call
- *
- * Accepts a name for the branch to be merged
- *
- * @access public
- * @param string $branch
- * @return string
- */
- public function merge($branch) {
- return $this->run("merge $branch --no-ff");
- }
-
-
- /**
- * Runs a git fetch on the current branch
- *
- * @access public
- * @return string
- */
- public function fetch() {
- return $this->run("fetch");
- }
-
- /**
- * Add a new tag on the current position
- *
- * Accepts the name for the tag and the message
- *
- * @param string $tag
- * @param string $message
- * @return string
- */
- public function add_tag($tag, $message = null) {
- if ($message === null) {
- $message = $tag;
- }
- return $this->run("tag -a $tag -m " . escapeshellarg($message));
- }
-
- /**
- * List all the available repository tags.
- *
- * Optionally, accept a shell wildcard pattern and return only tags matching it.
- *
- * @access public
- * @param string $pattern Shell wildcard pattern to match tags against.
- * @return array Available repository tags.
- */
- public function list_tags($pattern = null) {
- $tagArray = explode("\n", $this->run("tag -l $pattern"));
- foreach ($tagArray as $i => &$tag) {
- $tag = trim($tag);
- if ($tag == '') {
- unset($tagArray[$i]);
- }
- }
-
- return $tagArray;
- }
-
- /**
- * Push specific branch to a remote
- *
- * Accepts the name of the remote and local branch
- *
- * @param string $remote
- * @param string $branch
- * @return string
- */
- public function push($remote, $branch) {
- return $this->run("push --tags $remote $branch");
- }
-
- /**
- * Pull specific branch from remote
- *
- * Accepts the name of the remote and local branch
- *
- * @param string $remote
- * @param string $branch
- * @return string
- */
- public function pull($remote, $branch) {
- return $this->run("pull $remote $branch");
- }
-
- /**
- * List log entries.
- *
- * @param strgin $format
- * @return string
- */
- public function log($format = null) {
- if ($format === null)
- return $this->run('log');
- else
- return $this->run('log --pretty=format:"' . $format . '"');
- }
-
- /**
- * Sets the project description.
- *
- * @param string $new
- */
- public function set_description($new) {
- $path = $this->git_directory_path();
- file_put_contents($path."/description", $new);
- }
-
- /**
- * Gets the project description.
- *
- * @return string
- */
- public function get_description() {
- $path = $this->git_directory_path();
- return file_get_contents($path."/description");
- }
-
- /**
- * Sets custom environment options for calling Git
- *
- * @param string key
- * @param string value
- */
- public function setenv($key, $value) {
- $this->envopts[$key] = $value;
- }
-
-}
-
-/* End of file */
\ No newline at end of file
diff --git a/git/autoload.inc b/git/autoload.inc
deleted file mode 100644
index 3f1c2c2..0000000
--- a/git/autoload.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-logged){
return false;} //alrdy logged(this prevents proper thrown value for every system exception)
- \SYSTEM\DBD\SYS_LOG_INSERT::Q1( array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(),
+ \SYSTEM\DBD\SYS_LOG_INSERT::Q1( /*array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(),
getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5),
$_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST),
array_key_exists('HTTP_REFERER', $_SERVER) ? $_SERVER['HTTP_REFERER'] : null,
array_key_exists('HTTP_USER_AGENT',$_SERVER) ? $_SERVER['HTTP_USER_AGENT'] : null,
- ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null, $thrown ? 1 : 0),
+ ($user = \SYSTEM\SECURITY\Security::getUser()) ? $user->id : null, $thrown ? 1 : 0),*/
array( get_class($E), $E->getMessage(), $E->getCode(), $E->getFile(), $E->getLine(), $E->getTraceAsString(),
getenv('REMOTE_ADDR'),round(microtime(true) - \SYSTEM\time::getStartTime(),5),date('Y-m-d H:i:s', microtime(true)),
$_SERVER["SERVER_NAME"],$_SERVER["SERVER_PORT"],$_SERVER['REQUEST_URI'], serialize($_POST),
diff --git a/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php
index c858c26..6bb27ec 100644
--- a/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php
+++ b/sai/modules/saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php
@@ -1,11 +1,11 @@
query('SELECT COUNT(*)as "count" FROM system.cache');
- } else {
- $res = $con->query('SELECT COUNT(*) as count FROM system_cache');
- }
-
- $r = $res->next();
-
- $result = '
System Cache '.
- 'Entries: '.$r['count'].' showing 100'.
- ''.
- ''.''.'ID'.' '.''.'CacheID'.' '.''.'Ident'.' '.''.'Data'.' '.' ';
-
-
- if(\SYSTEM\system::isSystemDbInfoPG()){
- $res = $con->query('SELECT *, encode(data,\'base64\') FROM system.cache ORDER BY "ID" ASC LIMIT 100;');
- } else {
- $res = $con->query('SELECT * FROM system_cache ORDER BY ID ASC LIMIT 100;');
- }
-
- while($r = $res->next()){
- $result .= ''.''.$r['ID'].' '.''.$r['CacheID'].' '.''.$r['Ident'].' '.''.' '.' '.' ';}
-
- $result .= '
';
-
- return $result;
+ $vars = array();
+ $vars['count'] = \SYSTEM\DBD\SYS_SAIMOD_CACHE_COUNT::Q1()['count'];
+ $vars['entries'] = '';
+ $res = \SYSTEM\DBD\SYS_SAIMOD_CACHE::QQ();
+ while($r = $res->next()){
+ $r['class'] = self::tablerow_class($r['CacheID']);
+ $vars['entries'] .= \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl'), $r);}
+ return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\SERVERPATH(new \SYSTEM\PSAI(),'modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl'), $vars);
}
private static function tablerow_class($cacheID){
if($cacheID == 1){
return 'info';}
-
- return 'success';
- }
+ return 'success';}
- //public static function html_li_menu(){return ' ';}
public static function html_li_menu(){return ' ';}
public static function right_public(){return false;}
public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);}
diff --git a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl
new file mode 100644
index 0000000..5044a08
--- /dev/null
+++ b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl
@@ -0,0 +1,11 @@
+System Cache
+Entries: ${count} showing 100
+
+
+ ID
+ CacheID
+ Ident
+ Data
+
+ ${entries}
+
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl
new file mode 100644
index 0000000..e4bf11e
--- /dev/null
+++ b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache_entry.tpl
@@ -0,0 +1,6 @@
+
+ ${ID}
+ ${CacheID}
+ ${Ident}
+
+
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php b/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php
index 5fa8721..a49cd66 100644
--- a/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php
+++ b/sai/modules/saimod_sys_cron/qq/SYS_SAIMOD_CRON.php
@@ -1,11 +1,11 @@
'', 'git_system' => '');
try{
- $repo = \SYSTEM\GIT\Git::open(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH));
+ $repo = \GIT\Git::open(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH));
+ $result['git_project'] = ''.$repo->run('rev-parse --short HEAD').' ';
+ $result['git_project'] .= $repo->run('log -1 --pretty=%B');
+
} catch (\Exception $ex) {
$result['git_project'] = $ex->getMessage();
}
try{
- $repo = \SYSTEM\GIT\Git::open(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH).\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL));
+ $repo = \GIT\Git::open(\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEPATH).\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_SYSTEMPATHREL));
+ $result['git_system'] .= '';
+ $result['git_system'] = ''.$repo->run('rev-parse --short HEAD').' ';
+ $result['git_system'] .= $repo->run('log -1 --pretty=%B');
} catch (\Exception $ex) {
$result['git_system'] = $ex->getMessage();
}
diff --git a/sai/modules/saimod_sys_git/tpl/saimod_sys_git.tpl b/sai/modules/saimod_sys_git/tpl/saimod_sys_git.tpl
index f43157a..6a7b19b 100644
--- a/sai/modules/saimod_sys_git/tpl/saimod_sys_git.tpl
+++ b/sai/modules/saimod_sys_git/tpl/saimod_sys_git.tpl
@@ -1,5 +1,5 @@
${sai_git_title}
-${sai_git_project_version}: ${git_project}
+Current Project Version: ${git_project}
-${sai_git_system_version}: ${git_system}
\ No newline at end of file
+Current SYSTEM Version: ${git_system}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_log/js/saimod_sys_log.js b/sai/modules/saimod_sys_log/js/saimod_sys_log.js
index 61d10f9..f71b785 100644
--- a/sai/modules/saimod_sys_log/js/saimod_sys_log.js
+++ b/sai/modules/saimod_sys_log/js/saimod_sys_log.js
@@ -9,8 +9,8 @@ function init_saimod_sys_log() {
};
function register_search(){
- $('#btn_search').click(function(){
- system.load($(this).attr('state')+$('#input_search').val(),true);
+ $('#btn_search_log').click(function(){
+ system.load($(this).attr('state')+$('#input_search_log').val(),true);
});
}
diff --git a/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php
index da49f4d..c2ba637 100644
--- a/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php
+++ b/sai/modules/saimod_sys_log/qq/SYS_SAIMOD_LOG_ANALYTICS.php
@@ -1,12 +1,8 @@
${basic_all}
${error_filter}
- ${basic_search}
-
+ ${basic_search}
+
${basic_rows}: ${count} ${basic_page}: ${page}
diff --git a/sai/modules/saimod_sys_login/js/sai_sys_login_submit.js b/sai/modules/saimod_sys_login/js/sai_sys_login_submit.js
index e63b117..d42e096 100644
--- a/sai/modules/saimod_sys_login/js/sai_sys_login_submit.js
+++ b/sai/modules/saimod_sys_login/js/sai_sys_login_submit.js
@@ -43,16 +43,11 @@ function init_saimod_sys_login() {
}
});
- $("#register_link").click(function(){
- $('div#content-wrapper').load('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_login&action=registerform',function(){
- init__SYSTEM_SAI_saimod_sys_login_register();
- });
- });
};
-function init__SYSTEM_SAI_saimod_sys_login_register(){
+function init_saimod_sys_register(){
$('#btn_user_registration_cancel').click(function(){
- loadModuleContent('.SYSTEM.SAI.saimod_sys_login');
+ system.load('login');
});
diff --git a/sai/modules/saimod_sys_login/tpl/login.tpl b/sai/modules/saimod_sys_login/tpl/login.tpl
index 71b62b8..a31a806 100644
--- a/sai/modules/saimod_sys_login/tpl/login.tpl
+++ b/sai/modules/saimod_sys_login/tpl/login.tpl
@@ -29,5 +29,5 @@
${basic_login}
-${basic_text_register}
+${basic_text_register}
${basic_text_password_miss}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_ADD.php b/sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_ADD.php
index eeb7d9e..974b8f8 100644
--- a/sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_ADD.php
+++ b/sai/modules/saimod_sys_page/qq/SYS_SAIMOD_PAGE_ADD.php
@@ -1,11 +1,11 @@
seek(100*$page);
diff --git a/sai/modules/saimod_sys_text/qq/SYS_SAIMOD_TEXT_COUNT.php b/sai/modules/saimod_sys_text/qq/SYS_SAIMOD_TEXT_COUNT.php
index 04f13c5..4be120f 100644
--- a/sai/modules/saimod_sys_text/qq/SYS_SAIMOD_TEXT_COUNT.php
+++ b/sai/modules/saimod_sys_text/qq/SYS_SAIMOD_TEXT_COUNT.php
@@ -1,15 +1,12 @@
${basic_rows}: ${count} ${basic_page}: ${page}
-
-
- ${table_id}
- ${table_lang}
- ${table_text}
- ${table_author}
- ${table_time_create}
- ${table_author_edit}
- ${table_time_edit}
-
- ${entries}
+
+
+
+ ${table_id}
+ ${table_lang}
+ ${table_text}
+ ${table_author}
+ ${table_time_create}
+ ${table_author_edit}
+ ${table_time_edit}
+
+
+
+ ${entries}
+
-
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl
index 0d4d774..3b59aaf 100644
--- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl
+++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo.tpl
@@ -21,7 +21,7 @@
thrown ${thrown}
message ${message}
-
${basic_back}
+
${basic_back}
${basic_close}
diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl
index 80b057f..dcfbac0 100644
--- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl
+++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo_todo_user.tpl
@@ -20,7 +20,7 @@
-
${basic_back}
+
${basic_back}
${basic_edit}
diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl
index bc01691..32419f4 100644
--- a/sai/modules/saimod_sys_todo/tpl/todo_list.tpl
+++ b/sai/modules/saimod_sys_todo/tpl/todo_list.tpl
@@ -7,8 +7,8 @@
${basic_generated}
${basic_user}
${basic_report}
-
${basic_search}
-
+
${basic_search}
+
${basic_rows}: ${count} ${basic_page}: ${page}
diff --git a/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl b/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl
index 9ba0130..32fa8a8 100644
--- a/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl
+++ b/sai/modules/saimod_sys_todo/tpl/todo_list_pagination.tpl
@@ -1 +1 @@
-${page}
\ No newline at end of file
+${page}
\ No newline at end of file
diff --git a/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl
index 6c1a7e2..177e4c8 100644
--- a/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl
+++ b/sai/modules/saimod_sys_todo/tpl/todo_stats.tpl
@@ -14,14 +14,12 @@
${project_all}
${project}%
-
-
${table_username}
${table_open}
${table_closed}
${table_all}
- ${table_percentage}
+ ${table_done}
${userstats}
\ No newline at end of file
diff --git a/sai/modules/saistart_sys_sai/css/saistart_sys_sai.css b/sai/modules/saistart_sys_sai/css/saistart_sys_sai.css
index e20bd8d..4d8ee3c 100644
--- a/sai/modules/saistart_sys_sai/css/saistart_sys_sai.css
+++ b/sai/modules/saistart_sys_sai/css/saistart_sys_sai.css
@@ -2,6 +2,10 @@
/* width: 1250px;*/
}
+#sai_datetime {
+ font-weight: bold;
+ text-align: right;
+}
#container_top .well{
/* height: 220px;*/
/* min-width: 250px;*/
diff --git a/sai/modules/saistart_sys_sai/js/saistart_sys_sai.js b/sai/modules/saistart_sys_sai/js/saistart_sys_sai.js
index 5f64407..40fd629 100644
--- a/sai/modules/saistart_sys_sai/js/saistart_sys_sai.js
+++ b/sai/modules/saistart_sys_sai/js/saistart_sys_sai.js
@@ -1,5 +1,4 @@
-//function init__SYSTEM_SAI_saistart_sys_sai() {
-function init_saistart_sys_sai() {
+function init_saistart_sys_sai() {
var heights = $(".inner-page").map(function() {
return $(this).height();
@@ -40,4 +39,16 @@ function init_saistart_sys_sai() {
}
});
-};
\ No newline at end of file
+};
+
+function init_saistart_sys_sai_todo(){
+ $('#btn_search_todo').click(function(){
+ system.load($(this).attr('state')+$('#input_search_todo').val(),true);
+ });
+}
+
+function init_saistart_sys_sai_log(){
+ $('#btn_search_log').click(function(){
+ system.load($(this).attr('state')+$('#input_search_log').val(),true);
+ });
+}
\ No newline at end of file
diff --git a/sai/modules/saistart_sys_sai/saistart_sys_sai.php b/sai/modules/saistart_sys_sai/saistart_sys_sai.php
index 4a69f7f..4144b5a 100644
--- a/sai/modules/saistart_sys_sai/saistart_sys_sai.php
+++ b/sai/modules/saistart_sys_sai/saistart_sys_sai.php
@@ -21,9 +21,15 @@ class saistart_sys_sai extends \SYSTEM\SAI\SaiModule {
}
protected static function html_content(){
+ //create timestamp
+ $week_number = date("W", time());
+ $date = date("l M Y", time());
+
if(!\SYSTEM\SECURITY\Security::isLoggedIn() || !\SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI)){
return \SYSTEM\PAGE\replace::replaceFile(\SYSTEM\WEBPATH(new \SYSTEM\PSAI(),'modules/saistart_sys_sai/tpl/content.tpl'));}
$vars = array();
+ $vars['week_number'] = $week_number;
+ $vars['date'] = $date;
$vars['project_name'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_SAI_CONFIG_PROJECT);
$vars['project_url'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL);
$vars['analytics'] = \SYSTEM\SAI\saimod_sys_log::analytics();
diff --git a/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl b/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl
index 4d821c3..6c535a8 100644
--- a/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl
+++ b/sai/modules/saistart_sys_sai/tpl/content_loggedin.tpl
@@ -1,6 +1,7 @@
${sai_start_welcome}
${sai_start_welcome_description}
+
Week of the year: ${week_number} , ${date}
diff --git a/sai/page/css/sai.css b/sai/page/css/sai.css
index 0fe8afe..ddcac5d 100644
--- a/sai/page/css/sai.css
+++ b/sai/page/css/sai.css
@@ -31,6 +31,10 @@
.sai_main_menu {
border-radius: 3px 3px 3px 0;
}
+
+.nav-tabs {
+ border: none;
+}
/* auto collapsing navbar */
#sys_autocollapse.collapsed .navbar-header {
float: none;
diff --git a/sai/page/tpl/sai.tpl b/sai/page/tpl/sai.tpl
index ff5a939..de2c620 100644
--- a/sai/page/tpl/sai.tpl
+++ b/sai/page/tpl/sai.tpl
@@ -36,7 +36,8 @@
-
+ ${basic_project_menu}
+
diff --git a/security/Security.php b/security/Security.php
index fb87951..9dfabaa 100644
--- a/security/Security.php
+++ b/security/Security.php
@@ -13,11 +13,11 @@ class Security {
$result = \SYSTEM\DBD\SYS_SECURITY_CREATE::QI(array( $username , $password, $email, $locale, 1 ));
if(!$result || !self::login($username, $password, $locale)){
return self::FAIL;}
- return ($advancedResult ? \SYSTEM\DBD\SYS_SECURITY_LOGIN_SHA1::Q1(array($username, $password),array($username, $username, $password)) : self::OK);
+ return ($advancedResult ? \SYSTEM\DBD\SYS_SECURITY_LOGIN_SHA1::Q1(array($username, $username, $password)) : self::OK);
}
public static function changePassword($username, $password_sha_old, $password_sha_new){
- $row = \SYSTEM\DBD\SYS_SECURITY_LOGIN_SHA1::Q1(array($username, $password_sha_old),array($username, $username, $password_sha_old));
+ $row = \SYSTEM\DBD\SYS_SECURITY_LOGIN_SHA1::Q1(array($username, $username, $password_sha_old));
if(!$row){
return self::FAIL;} // old password wrong
$userID = $row['id'];
@@ -31,9 +31,9 @@ class Security {
//Database check
if(isset($password_md5)){
- $row = \SYSTEM\DBD\SYS_SECURITY_LOGIN_MD5::Q1(array($username, $password_sha, $password_md5),array($username, $username, $password_sha, $password_md5));
+ $row = \SYSTEM\DBD\SYS_SECURITY_LOGIN_MD5::Q1(array($username, $username, $password_sha, $password_md5));
}else{
- $row = \SYSTEM\DBD\SYS_SECURITY_LOGIN_SHA1::Q1(array($username, $password_sha),array($username, $username, $password_sha));}
+ $row = \SYSTEM\DBD\SYS_SECURITY_LOGIN_SHA1::Q1(array($username, $username, $password_sha));}
if(!$row){
new \SYSTEM\LOG\WARNING("Login Failed, User was not found in db");