From 7dc84355d814bb6b0e4748cb80cbde7d68c9b7b3 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 25 Jul 2017 11:18:12 +0200 Subject: [PATCH] fixed saimod_docu, system docu, updated all lib references --- api/api_default.php | 4 ++ api/api_login.php | 6 +- cron/cron.php | 6 ++ db/connection/Connection.php | 1 + db/connection/ConnectionAMQP.php | 1 + db/connection/ConnectionAbstr.php | 1 + db/connection/ConnectionMYS.php | 1 + db/connection/ConnectionPG.php | 1 + db/connection/ConnectionSQLite.php | 1 + docu/autoload.inc | 3 +- docu/docu.php | 63 ++++++++++++++----- docu/docu_package.php | 24 +++++++ docu/docu_system.php | 50 +++++++++++++++ lib/animate | 2 +- lib/bootstrap | 2 +- lib/bootstrap_growl | 2 +- lib/git | 2 +- lib/jqbootstrapvalidation | 2 +- lib/jquery | 2 +- lib/jstree | 2 +- lib/lettering | 2 +- lib/markdown | 2 +- lib/minify | 2 +- lib/phpdoc_md | 2 +- lib/phpdocumentor | 2 +- lib/scssphp | 2 +- lib/tablesorter | 2 +- lib/textillate | 2 +- lib/tinymce | 2 +- .../saimod_sys_api/tpl/saimod_sys_api.tpl | 4 +- .../saimod_sys_cache/tpl/saimod_sys_cache.tpl | 4 +- .../tpl/saimod_sys_config.tpl | 4 +- .../saimod_sys_cron/saimod_sys_cron.php | 6 ++ .../saimod_sys_cron/tpl/saimod_sys_cron.tpl | 4 +- .../saimod_sys_docu/js/saimod_sys_docu.js | 2 +- .../saimod_sys_docu/saimod_sys_docu.php | 46 +++++--------- .../saimod_sys_docu/tpl/saimod_sys_docu.tpl | 8 ++- .../tpl/saimod_sys_docu_iframe.tpl | 1 - sai/modules/saimod_sys_docu/tpl/tabopt.tpl | 2 +- .../saimod_sys_files/tpl/saimod_sys_files.tpl | 6 +- .../saimod_sys_git/tpl/saimod_sys_git.tpl | 4 +- .../saimod_sys_log/tpl/saimod_sys_log.tpl | 4 +- .../saimod_sys_login/saimod_sys_login.php | 7 ++- .../saimod_sys_mod/tpl/saimod_sys_mod.tpl | 4 +- .../saimod_sys_page/tpl/saimod_sys_page.tpl | 4 +- .../tpl/saimod_sys_security.tpl | 4 +- .../saimod_sys_text/tpl/saimod_sys_text.tpl | 4 +- .../saimod_sys_todo/tpl/saimod_sys_todo.tpl | 4 +- sai/sai/saigui.php | 27 -------- .../qq/SYS_SECURITY_UPDATE_LASTACTIVE.php | 5 ++ security/security.php | 7 +++ sql/mysql/data/system_page.sql | 4 +- sql/mysql/data/system_sai_api.sql | 2 +- system/time.php | 8 +++ token/qq/SYS_TOKEN_INSERT.php | 5 ++ token/token.php | 13 ++++ token/token_change_email.php | 12 ++++ token/token_confirm_email.php | 14 ++++- token/token_handler.php | 12 ++++ token/token_reset_password.php | 14 ++++- 60 files changed, 309 insertions(+), 130 deletions(-) create mode 100644 docu/docu_package.php create mode 100644 docu/docu_system.php delete mode 100644 sai/modules/saimod_sys_docu/tpl/saimod_sys_docu_iframe.tpl diff --git a/api/api_default.php b/api/api_default.php index 9de3251..c04a504 100644 --- a/api/api_default.php +++ b/api/api_default.php @@ -11,6 +11,10 @@ */ namespace SYSTEM\API; +/** + * api_default Interface used internally in api_default Class + * can be used insted of api_default if hashbang mechanic should not be used. + */ interface api_default_interface { /** * API Group function - implement this function and return the Groupnumber diff --git a/api/api_login.php b/api/api_login.php index c17eb5b..0fdc754 100644 --- a/api/api_login.php +++ b/api/api_login.php @@ -94,8 +94,8 @@ class api_login { * System Account Change Password * * @param string $username Username - * @param sha1 $old_password_sha1 Users Old Password SHA1 String - * @param sha1 $new_password_sha1 Users New Password SHA1 String + * @param string $old_password_sha1 Users Old Password SHA1 String + * @param string $new_password_sha1 Users New Password SHA1 String * @return JSON Returns JSON result with success/failure status */ public static function call_account_action_change_password($old_password_sha1,$new_password_sha1){ @@ -105,7 +105,7 @@ class api_login { * System Account Request Change EMail Token * * @param string $username Username - * @param email $new_email Users new EMail Address + * @param string $new_email Users new EMail Address * @return JSON Returns JSON result with success/failure status */ public static function call_account_action_change_email($new_email){ diff --git a/cron/cron.php b/cron/cron.php index fa11ec5..cd8f58e 100644 --- a/cron/cron.php +++ b/cron/cron.php @@ -58,6 +58,12 @@ class cron { return \SYSTEM\LOG\JsonResult::ok(); } + /** + * Run a specific registered Cronjob by classname if its time to do so. + * + * @param string Classname of the cronjob + * @return JSON Returns Json::ok() + */ public static function run_class($class){ $cron = \SYSTEM\SQL\SYS_SAIMOD_CRON_SINGLE_SELECT::Q1(array($class)); if(!$cron){ diff --git a/db/connection/Connection.php b/db/connection/Connection.php index 6457bdf..a4b0f27 100644 --- a/db/connection/Connection.php +++ b/db/connection/Connection.php @@ -59,6 +59,7 @@ class Connection extends ConnectionAbstr{ * @param string $stmtName Name of the Statement - espec for PostgreSQL important * @param string $stmt SQL string of the Statement * @param array $values Array of Prepare Values + * @param string $types types sql prepare string * @return Result Returns Database Query Result. */ public function prepare($stmtName, $stmt, $values, $types = null){ diff --git a/db/connection/ConnectionAMQP.php b/db/connection/ConnectionAMQP.php index 7a650d4..da2cc6e 100644 --- a/db/connection/ConnectionAMQP.php +++ b/db/connection/ConnectionAMQP.php @@ -100,6 +100,7 @@ class ConnectionAMQP extends ConnectionAbstr { * @param string $stmtName Name of the Statement - espec for PostgreSQL important * @param string $stmt SQL string of the Statement * @param array $values Array of Prepare Values + * @param string $types types sql prepare string * @return Result Returns Database Query Result. */ public function prepare($stmtName, $stmt, $values, $types = null){ diff --git a/db/connection/ConnectionAbstr.php b/db/connection/ConnectionAbstr.php index 5f4afde..98b3f02 100644 --- a/db/connection/ConnectionAbstr.php +++ b/db/connection/ConnectionAbstr.php @@ -40,6 +40,7 @@ abstract class ConnectionAbstr { * @param string $stmtName Name of the Statement - espec for PostgreSQL important * @param string $stmt SQL string of the Statement * @param array $values Array of Prepare Values + * @param string $types types sql prepare string * @return Result Returns Database Query Result. */ abstract public function prepare($stmtName, $stmt, $values, $types = null); diff --git a/db/connection/ConnectionMYS.php b/db/connection/ConnectionMYS.php index 844b246..1e910c0 100644 --- a/db/connection/ConnectionMYS.php +++ b/db/connection/ConnectionMYS.php @@ -57,6 +57,7 @@ class ConnectionMYS extends ConnectionAbstr { * @param string $stmtName Name of the Statement - espec for PostgreSQL important * @param string $stmt SQL string of the Statement * @param array $values Array of Prepare Values + * @param string $types types sql prepare string * @return Result Returns Database Query Result. */ public function prepare($stmtName, $stmt, $values, $types = null){ diff --git a/db/connection/ConnectionPG.php b/db/connection/ConnectionPG.php index 31f92c0..fac176c 100644 --- a/db/connection/ConnectionPG.php +++ b/db/connection/ConnectionPG.php @@ -49,6 +49,7 @@ class ConnectionPG extends ConnectionAbstr { * @param string $stmtName Name of the Statement - espec for PostgreSQL important * @param string $stmt SQL string of the Statement * @param array $values Array of Prepare Values + * @param string $types types sql prepare string * @return Result Returns Database Query Result. */ public function prepare($stmtName, $stmt, $values, $types = null){ diff --git a/db/connection/ConnectionSQLite.php b/db/connection/ConnectionSQLite.php index 18f2458..a0e2f89 100644 --- a/db/connection/ConnectionSQLite.php +++ b/db/connection/ConnectionSQLite.php @@ -50,6 +50,7 @@ class ConnectionSQLite extends ConnectionAbstr { * @param string $stmtName Name of the Statement - espec for PostgreSQL important * @param string $stmt SQL string of the Statement * @param array $values Array of Prepare Values + * @param string $types types sql prepare string * @return Result Returns Database Query Result. */ public function prepare($stmtName, $stmt, $values, $types = null){ diff --git a/docu/autoload.inc b/docu/autoload.inc index 18358b9..080568c 100644 --- a/docu/autoload.inc +++ b/docu/autoload.inc @@ -1,2 +1,3 @@ 'system', + 'inpath' => new \SYSTEM\PSYSTEM(), + 'outpath' => new \SYSTEM\PSYSTEM('docu/system/'), + 'inpath_md' => new \SYSTEM\PSYSTEM('docu/system/structure.xml'), + 'outpath_md' => new \SYSTEM\PSYSTEM('docu/system_wiki/'), + 'cachepath' => new \SYSTEM\PSYSTEM('docu/system/cache/'), + 'ignore' => array( 'lib/animate/*', + 'lib/bootstrap/*', + 'lib/bootstrap_growl/*', + 'lib/git/*', + 'lib/jqbootstrapvalidation/*', + 'lib/jquery/*', + 'lib/lettering/*', + 'lib/markdown/*', + 'lib/minify/*', + 'lib/phpdocumentor/*', + 'lib/scssphp/*', + 'lib/tablesorter/*', + 'lib/textillate/*', + 'lib/tinymce/*', + 'lib/jstree/*', + 'lib/phpdoc_md/*'), + 'sourcecode' => true, + 'parseprivate' => false, + 'title' => 'SYSTEM - PHP Framework'); + } +} \ No newline at end of file diff --git a/lib/animate b/lib/animate index b117ce5..6dd8080 160000 --- a/lib/animate +++ b/lib/animate @@ -1 +1 @@ -Subproject commit b117ce583f21c3258d73c0e336b5c511f5fe90a3 +Subproject commit 6dd8080bcbc247178396e6f6d6cbf0fc0aae0b40 diff --git a/lib/bootstrap b/lib/bootstrap index a731416..b21ee2a 160000 --- a/lib/bootstrap +++ b/lib/bootstrap @@ -1 +1 @@ -Subproject commit a73141649db6e58fda9d4a0d1db271c38460bce5 +Subproject commit b21ee2aa54e35388bcefbea05053045060abea8b diff --git a/lib/bootstrap_growl b/lib/bootstrap_growl index aa913c9..b674508 160000 --- a/lib/bootstrap_growl +++ b/lib/bootstrap_growl @@ -1 +1 @@ -Subproject commit aa913c90511b035125888fe45e41521f85dfbb56 +Subproject commit b674508ed84fec7643dcc0be483841d4bf2ef1f9 diff --git a/lib/git b/lib/git index c0b6ba4..0372a2f 160000 --- a/lib/git +++ b/lib/git @@ -1 +1 @@ -Subproject commit c0b6ba477ddef31f20b1363256e0a87c1c93b06e +Subproject commit 0372a2f50e97fe333f7eae0d3bfd2c47b8d4f697 diff --git a/lib/jqbootstrapvalidation b/lib/jqbootstrapvalidation index 1f6f4ea..ff0ae20 160000 --- a/lib/jqbootstrapvalidation +++ b/lib/jqbootstrapvalidation @@ -1 +1 @@ -Subproject commit 1f6f4ea7e6eab0f9c0a740530e957d3d73851d14 +Subproject commit ff0ae2033b0091f2ace860a683cedb931e2c5a9c diff --git a/lib/jquery b/lib/jquery index 5cbffcf..967f38f 160000 --- a/lib/jquery +++ b/lib/jquery @@ -1 +1 @@ -Subproject commit 5cbffcf4e9a888ee0a80addaf2a68006cc8a7124 +Subproject commit 967f38f6c8ca7569b063673f9083aa98e099be92 diff --git a/lib/jstree b/lib/jstree index b632e12..95926d3 160000 --- a/lib/jstree +++ b/lib/jstree @@ -1 +1 @@ -Subproject commit b632e12b1f2ac67ab2a6a3cb09f93524f27348bd +Subproject commit 95926d395734a9ed7f958d5422b50f21dfb8dde4 diff --git a/lib/lettering b/lib/lettering index fa77e99..0d964b1 160000 --- a/lib/lettering +++ b/lib/lettering @@ -1 +1 @@ -Subproject commit fa77e997e3fec513cf55416c9f21ce57abcdece4 +Subproject commit 0d964b18551f61385da9208bc8daecf267d1398d diff --git a/lib/markdown b/lib/markdown index 71b6af6..1caf559 160000 --- a/lib/markdown +++ b/lib/markdown @@ -1 +1 @@ -Subproject commit 71b6af6e9b3750fdc54327b53bc09631ac48ef1d +Subproject commit 1caf5595d88a06e33795304b871d3c2330e408a8 diff --git a/lib/minify b/lib/minify index dcdc55c..1e4a4f1 160000 --- a/lib/minify +++ b/lib/minify @@ -1 +1 @@ -Subproject commit dcdc55caa503283a66a5a9a1325f3f27b1475f6c +Subproject commit 1e4a4f181d3b3c28c5ac292d8c23fe93bce6dd12 diff --git a/lib/phpdoc_md b/lib/phpdoc_md index 85f3a6b..848d577 160000 --- a/lib/phpdoc_md +++ b/lib/phpdoc_md @@ -1 +1 @@ -Subproject commit 85f3a6b5a64fd99477d00e0f014789c81fa3c234 +Subproject commit 848d57765b8fb9bed5c5ab6746301e8b0439c4ca diff --git a/lib/phpdocumentor b/lib/phpdocumentor index f0c4f33..ef39cf9 160000 --- a/lib/phpdocumentor +++ b/lib/phpdocumentor @@ -1 +1 @@ -Subproject commit f0c4f33ba8bfb1904b424e1611d93974d38aa808 +Subproject commit ef39cf938da5165a38cf01b5ab980d0dbf2c1108 diff --git a/lib/scssphp b/lib/scssphp index bac779a..84ca545 160000 --- a/lib/scssphp +++ b/lib/scssphp @@ -1 +1 @@ -Subproject commit bac779a7b9ef053b8253d4d76c594b03b19157aa +Subproject commit 84ca5459fda67dbd01c3a2f1e57ea72d50b938f0 diff --git a/lib/tablesorter b/lib/tablesorter index f8158bf..2492c3e 160000 --- a/lib/tablesorter +++ b/lib/tablesorter @@ -1 +1 @@ -Subproject commit f8158bfdea25f8fae9687e5f999d2258a05f1965 +Subproject commit 2492c3e6e1042d744320cfcf551b2da9e6d8068c diff --git a/lib/textillate b/lib/textillate index 4ca4373..aab326a 160000 --- a/lib/textillate +++ b/lib/textillate @@ -1 +1 @@ -Subproject commit 4ca4373942cce18aa11b59c7c5ddfd31181f757e +Subproject commit aab326ad891a1af1570bb2c8e51abc800fa85db6 diff --git a/lib/tinymce b/lib/tinymce index 6a3078b..48460ac 160000 --- a/lib/tinymce +++ b/lib/tinymce @@ -1 +1 @@ -Subproject commit 6a3078b3f22b6d2189fdc3d5ddec49365120bc39 +Subproject commit 48460acec927a79366c789e4ddf9e40cbc3db42e diff --git a/sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl b/sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl index cbb8f76..d99ca65 100644 --- a/sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl +++ b/sai/modules/saimod_sys_api/tpl/saimod_sys_api.tpl @@ -1,6 +1,6 @@
-
-

  ${sai_api_title}

+
+

   ${sai_api_title}

diff --git a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl index 6b43ac0..651d2bf 100644 --- a/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl +++ b/sai/modules/saimod_sys_cache/tpl/saimod_sys_cache.tpl @@ -1,6 +1,6 @@
-
-

  ${sai_cache_title}

+
+

   ${sai_cache_title}

diff --git a/sai/modules/saimod_sys_config/tpl/saimod_sys_config.tpl b/sai/modules/saimod_sys_config/tpl/saimod_sys_config.tpl index 2e188c4..e560f73 100644 --- a/sai/modules/saimod_sys_config/tpl/saimod_sys_config.tpl +++ b/sai/modules/saimod_sys_config/tpl/saimod_sys_config.tpl @@ -1,6 +1,6 @@
-
-

  ${sai_config_title}

+
+

   ${sai_config_title}

diff --git a/sai/modules/saimod_sys_cron/saimod_sys_cron.php b/sai/modules/saimod_sys_cron/saimod_sys_cron.php index 533fab7..4070349 100644 --- a/sai/modules/saimod_sys_cron/saimod_sys_cron.php +++ b/sai/modules/saimod_sys_cron/saimod_sys_cron.php @@ -50,6 +50,12 @@ class saimod_sys_cron extends \SYSTEM\SAI\SaiModule { return \SYSTEM\LOG\JsonResult::ok(); } + /** + * Run a specifc Cron Job + * + * @param string $cls Classname of the Cron + * @return JSON Returns json with status true of error + */ public static function sai_mod__system_sai_saimod_sys_cron_action_run($cls){ if(!\SYSTEM\SECURITY\security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI_CRON)){ throw new \SYSTEM\LOG\ERROR("You dont have edit Rights - Cant proceeed");} diff --git a/sai/modules/saimod_sys_cron/tpl/saimod_sys_cron.tpl b/sai/modules/saimod_sys_cron/tpl/saimod_sys_cron.tpl index cf65e9e..4038beb 100644 --- a/sai/modules/saimod_sys_cron/tpl/saimod_sys_cron.tpl +++ b/sai/modules/saimod_sys_cron/tpl/saimod_sys_cron.tpl @@ -1,6 +1,6 @@
-
-

  ${sai_cron_title}

+
+

   ${sai_cron_title}

diff --git a/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js b/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js index a6b6345..14bec6d 100644 --- a/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js +++ b/sai/modules/saimod_sys_docu/js/saimod_sys_docu.js @@ -4,7 +4,7 @@ function init_saimod_sys_docu() { $(this).removeClass('active');}); $(this).parent().addClass('active'); }); - docu_menu(); + //docu_menu(); $('#btn_generate').click(function(){ $.ajax({ type :'GET', diff --git a/sai/modules/saimod_sys_docu/saimod_sys_docu.php b/sai/modules/saimod_sys_docu/saimod_sys_docu.php index a419c15..50939d6 100644 --- a/sai/modules/saimod_sys_docu/saimod_sys_docu.php +++ b/sai/modules/saimod_sys_docu/saimod_sys_docu.php @@ -18,33 +18,31 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule { /** * Generate the HTML for the Saimods startpage * + * @param string $cat Docu selected * @return string Returns HTML for the Saimods startpage */ - public static function sai_mod__SYSTEM_SAI_saimod_sys_docu(){ - $phpdocconfigs = \SYSTEM\DOCU\docu::getAll(); + public static function sai_mod__SYSTEM_SAI_saimod_sys_docu($cat = '\SYSTEM\DOCU\docu_system'){ + $docu_packages = \SYSTEM\DOCU\docu::getAll(); $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_DOCU); + $vars['iframesrc'] = \SYSTEM\DOCU\docu::get($cat)['outpath']->WEBPATH(false); $vars['tabopts'] = ''; - foreach($phpdocconfigs as $config){ - $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt.tpl'))->SERVERPATH(), array('tab_id' => $config['id'],'tab_id_pretty' => $config['title']));} + foreach($docu_packages as $package){ + $config = \SYSTEM\DOCU\docu::get($package); + $vars['tabopts'] .= \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/tabopt.tpl'))->SERVERPATH(), array('tab_id' => $package,'tab_id_pretty' => $config['title'], 'active' => $package == $cat ? 'active' : ''));} return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl'))->SERVERPATH(), $vars); } /** * Generate the HTML Documentation * - * @return null Returns null + * @return json Returns jsn with log */ public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_generate(){ - \LIB\lib_phpdocumentor::php(); - $configs = \SYSTEM\DOCU\docu::getAll(); - foreach($configs as $config){ - \phpdocumentor::run( $config['inpath'], - $config['outpath'], - $config['cachepath'], - $config['ignore'], - $config['title'], - $config['sourcecode'], - $config['parseprivate']);} + $result = array(); + $packages = \SYSTEM\DOCU\docu::getAll(); + foreach($packages as $package){ + $result[] = \SYSTEM\DOCU\docu::generate($package);} + return \SYSTEM\LOG\JsonResult::toString($result); } /** @@ -53,23 +51,11 @@ class saimod_sys_docu extends \SYSTEM\SAI\SaiModule { * @return null Returns null */ public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_generate_md(){ - \LIB\lib_phpdoc_md::php(); - $configs = \SYSTEM\DOCU\docu::getAll(); - foreach($configs as $config){ - \phpdoc_md::run( $config['inpath_md'], - $config['outpath_md']);} + $packages = \SYSTEM\DOCU\docu::getAll(); + foreach($packages as $package){ + \SYSTEM\DOCU\docu::generate_md($package);} } - /** - * Generate the HTML for the Iframe of the selected Category - * - * @param string $cat Category of the Documentation to be presented - * @return string Returns HTML - */ - public static function sai_mod__SYSTEM_SAI_saimod_sys_docu_action_cat($cat = 'system'){ - $vars = array('iframesrc' => \SYSTEM\DOCU\docu::get($cat)['outpath']->WEBPATH(false)); - return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_docu/tpl/saimod_sys_docu_iframe.tpl'))->SERVERPATH(), $vars);} - /** * Generate
  • Menu for the Saimod * diff --git a/sai/modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl b/sai/modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl index cfe84fc..d9f2c59 100644 --- a/sai/modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl +++ b/sai/modules/saimod_sys_docu/tpl/saimod_sys_docu.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_docu_title}

    +
    +

       ${sai_docu_title}

    @@ -17,7 +17,9 @@
    -
    +
    + +
    diff --git a/sai/modules/saimod_sys_docu/tpl/saimod_sys_docu_iframe.tpl b/sai/modules/saimod_sys_docu/tpl/saimod_sys_docu_iframe.tpl deleted file mode 100644 index 3bdf7b7..0000000 --- a/sai/modules/saimod_sys_docu/tpl/saimod_sys_docu_iframe.tpl +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/sai/modules/saimod_sys_docu/tpl/tabopt.tpl b/sai/modules/saimod_sys_docu/tpl/tabopt.tpl index c05c295..5e82c22 100644 --- a/sai/modules/saimod_sys_docu/tpl/tabopt.tpl +++ b/sai/modules/saimod_sys_docu/tpl/tabopt.tpl @@ -1 +1 @@ -
  • ${tab_id_pretty}
  • \ No newline at end of file +
  • ${tab_id_pretty}
  • \ No newline at end of file diff --git a/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl b/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl index 700b662..e2ea01a 100644 --- a/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl +++ b/sai/modules/saimod_sys_files/tpl/saimod_sys_files.tpl @@ -1,7 +1,7 @@
    -
    -

      ${sai_files_title}

    -
    ${sai_files_title_warning}
    +
    +

       ${sai_files_title}

    +
     ${sai_files_title_warning}
    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 c2590fc..550a310 100644 --- a/sai/modules/saimod_sys_git/tpl/saimod_sys_git.tpl +++ b/sai/modules/saimod_sys_git/tpl/saimod_sys_git.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_git_title}

    +
    +

       ${sai_git_title}

    diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl index 4887cd4..d2420bb 100644 --- a/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl +++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_log_title}

    +
    +

       ${sai_log_title}

    diff --git a/sai/modules/saimod_sys_login/saimod_sys_login.php b/sai/modules/saimod_sys_login/saimod_sys_login.php index 411f051..aaf0c1a 100644 --- a/sai/modules/saimod_sys_login/saimod_sys_login.php +++ b/sai/modules/saimod_sys_login/saimod_sys_login.php @@ -60,7 +60,12 @@ class saimod_sys_login extends \SYSTEM\SAI\SaiModule { public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_registerform(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_LOGIN); return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_login/tpl/register.tpl'))->SERVERPATH(), $vars);} - + + /** + * Request Password Reset + * + * @return string Returns HTML + */ public static function sai_mod__SYSTEM_SAI_saimod_sys_login_action_resetpassword(){ $vars = \SYSTEM\PAGE\text::tag(\SYSTEM\SQL\system_text::TAG_SAI_LOGIN); return \SYSTEM\PAGE\replace::replaceFile((new \SYSTEM\PSAI('modules/saimod_sys_login/tpl/resetpassword.tpl'))->SERVERPATH(), $vars);} diff --git a/sai/modules/saimod_sys_mod/tpl/saimod_sys_mod.tpl b/sai/modules/saimod_sys_mod/tpl/saimod_sys_mod.tpl index 68446ce..c6d8367 100644 --- a/sai/modules/saimod_sys_mod/tpl/saimod_sys_mod.tpl +++ b/sai/modules/saimod_sys_mod/tpl/saimod_sys_mod.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_mod_title}

    +
    +

       ${sai_mod_title}

    diff --git a/sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl b/sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl index 87c5955..9d35e1d 100644 --- a/sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl +++ b/sai/modules/saimod_sys_page/tpl/saimod_sys_page.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_page_title}

    +
    +

       ${sai_page_title}

    diff --git a/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl b/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl index 87a14b7..e916a9b 100644 --- a/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl +++ b/sai/modules/saimod_sys_security/tpl/saimod_sys_security.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_security_title}

    +
    +

       ${sai_security_title}

    diff --git a/sai/modules/saimod_sys_text/tpl/saimod_sys_text.tpl b/sai/modules/saimod_sys_text/tpl/saimod_sys_text.tpl index 4b3f282..ff34a2d 100644 --- a/sai/modules/saimod_sys_text/tpl/saimod_sys_text.tpl +++ b/sai/modules/saimod_sys_text/tpl/saimod_sys_text.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_text_title}

    +
    +

       ${sai_text_title}

    diff --git a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl index 0365e47..5ee8e1a 100644 --- a/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl +++ b/sai/modules/saimod_sys_todo/tpl/saimod_sys_todo.tpl @@ -1,6 +1,6 @@
    -
    -

      ${sai_todo_title}

    +
    +

       ${sai_todo_title}

    diff --git a/sai/sai/saigui.php b/sai/sai/saigui.php index 4eb6e16..e8bd84f 100644 --- a/sai/sai/saigui.php +++ b/sai/sai/saigui.php @@ -24,33 +24,6 @@ class saigui { * @return html Returns html of sai defaultpage. */ public function html(){ - //register docu here, we require path so system must be started - \SYSTEM\DOCU\docu::register(array( 'id' => 'system', - 'inpath' => new \SYSTEM\PSYSTEM(), - 'outpath' => new \SYSTEM\PSYSTEM('docu/system/'), - 'inpath_md' => new \SYSTEM\PSYSTEM('docu/system/structure.xml'), - 'outpath_md' => new \SYSTEM\PSYSTEM('docu/system_wiki/'), - 'cachepath' => new \SYSTEM\PSYSTEM('docu/system/cache/'), - 'ignore' => array( 'lib/animate/*', - 'lib/bootstrap/*', - 'lib/bootstrap_growl/*', - 'lib/git/*', - 'lib/jqbootstrapvalidation/*', - 'lib/jquery/*', - 'lib/lettering/*', - 'lib/markdown/*', - 'lib/minify/*', - 'lib/phpdocumentor/*', - 'lib/scssphp/*', - 'lib/tablesorter/*', - 'lib/textillate/*', - 'lib/tinymce/*', - 'lib/jstree/*', - 'lib/phpdoc_md/*'), - 'sourcecode' => true, - 'parseprivate' => false, - 'title' => 'SYSTEM - PHP Framework')); - \SYSTEM\SECURITY\security::isLoggedIn(); // refresh session //Direct JSON Input $pg = json_decode(file_get_contents("php://input"), true); diff --git a/security/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php b/security/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php index 7cf018d..768653d 100644 --- a/security/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php +++ b/security/qq/SYS_SECURITY_UPDATE_LASTACTIVE.php @@ -22,6 +22,11 @@ class SYS_SECURITY_UPDATE_LASTACTIVE extends \SYSTEM\DB\QP { */ public static function get_class(){return \get_class();} + /** + * SQL Insert Types + * + * @return string Returns sql Insert Types + */ public static function types(){return 'si'; } diff --git a/security/security.php b/security/security.php index 03bc7e1..52463ea 100644 --- a/security/security.php +++ b/security/security.php @@ -363,6 +363,13 @@ class security { $_SESSION['values'][\SYSTEM\locale::SESSION_KEY] = $_SESSION[\SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL)]->locale;} } + /** + * Update Sessiondata upon user infos change + * + * @param $data Data which has changed + * @param $session_id Session ID to be changed or null + * @return null Returns null. + */ public static function update_session_data($data,$session_id = null){ $old_session_id = \session_id(); if($session_id){ diff --git a/sql/mysql/data/system_page.sql b/sql/mysql/data/system_page.sql index 8ad20a9..ab4d477 100644 --- a/sql/mysql/data/system_page.sql +++ b/sql/mysql/data/system_page.sql @@ -16,8 +16,8 @@ REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login` REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (40, 42, 'cron', 'cron', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_cron', 'init_saimod_sys_cron', '\\SYSTEM\\SAI\\saimod_sys_cron'); -REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (50, 42, 'docu', 'docu', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu', 'init_saimod_sys_docu', '\\SYSTEM\\SAI\\saimod_sys_docu'); -REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (51, 42, 'cat', 'docu', 50, 0, 0, '#tab_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=cat&cat=${cat}', 'init_saimod_sys_docu_cat', '\\SYSTEM\\SAI\\saimod_sys_docu'); +REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (50, 42, 'docu', 'docu', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&cat=${cat}', 'init_saimod_sys_docu', '\\SYSTEM\\SAI\\saimod_sys_docu'); +-- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (51, 42, 'cat', 'docu', 50, 0, 0, '#tab_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=cat&cat=${cat}', 'init_saimod_sys_docu_cat', '\\SYSTEM\\SAI\\saimod_sys_docu'); -- REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (55, 42, 'doc', 'docu', 51, 0, 0, '#tab2_docu', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_docu&action=doc&cat=${cat}&doc=${doc}', 'init_saimod_sys_docu_doc', '\\SYSTEM\\SAI\\saimod_sys_docu'); REPLACE INTO `system_page` (`id`, `group`, `name`, `state`, `parent_id`, `login`, `type`, `div`, `url`, `func`, `php_class`) VALUES (60, 42, 'files', 'files', -1, 0, 0, '#content', './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files', 'init_saimod_sys_files', '\\SYSTEM\\SAI\\saimod_sys_files'); diff --git a/sql/mysql/data/system_sai_api.sql b/sql/mysql/data/system_sai_api.sql index 8b1ff68..6975030 100644 --- a/sql/mysql/data/system_sai_api.sql +++ b/sql/mysql/data/system_sai_api.sql @@ -186,7 +186,7 @@ REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `na REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1100, 42, 0, 0, '_SYSTEM_SAI_saimod_sys_docu', 'action', NULL); -REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1101, 42, 3, 1100, 'cat', 'cat', 'STRING'); +REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1101, 42, 3, 0, '_SYSTEM_SAI_saimod_sys_docu', 'cat', 'STRING'); -- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1110, 42, 3, 1100, 'doc', 'cat', 'STRING'); -- REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (1111, 42, 3, 1100, 'doc', 'doc', 'STRING'); diff --git a/system/time.php b/system/time.php index 868251d..9c0c01e 100644 --- a/system/time.php +++ b/system/time.php @@ -62,6 +62,14 @@ class time { } } + /** + * Calaculate the time which has to pass till the given timestamp. + * Scaling from seconds to years. Required strings from tag + * 'time' to be included. + * + * @param int $time Unixtimestamp to be converted + * @return string Returns scaled time string. + */ public static function time_in_string($time){ $etime = $time - time(); if ($etime < 1){ diff --git a/token/qq/SYS_TOKEN_INSERT.php b/token/qq/SYS_TOKEN_INSERT.php index e8e9427..bdb61ae 100644 --- a/token/qq/SYS_TOKEN_INSERT.php +++ b/token/qq/SYS_TOKEN_INSERT.php @@ -22,6 +22,11 @@ class SYS_TOKEN_INSERT extends \SYSTEM\DB\QP { */ public static function get_class(){return \get_class();} + /** + * SQL Insert Types + * + * @return string Returns sql Insert Types + */ public static function types(){return 'ssssis'; } diff --git a/token/token.php b/token/token.php index c75a619..41d014e 100644 --- a/token/token.php +++ b/token/token.php @@ -47,6 +47,7 @@ class token{ * * @param string $class Token_handler Class * @param array $data Data sved to Database for the token_handler on confirm + * @param string $post_script Function to be called after successfull token confirm * @return string Returns token string. */ public static function request($class,$data=array(),$post_script=null){ @@ -91,6 +92,12 @@ class token{ return \SYSTEM\SQL\SYS_TOKEN_CONFIRM::QI(array( \SYSTEM\SECURITY\security::isLoggedIn() ? \SYSTEM\SECURITY\security::getUser()->id : null, $token)); } + /** + * Call token text_success on success + * + * @param string $token token_handler Classname + * @return string Returns token success string. + */ public static function text_success($token){ $res = self::get($token); if(!\in_array($res['class'], self::$type_handlers)){ @@ -98,6 +105,12 @@ class token{ return \call_user_func_array(array($res['class'], 'text_success'),array($res)); } + /** + * Call token text_fail on fail + * + * @param string $token token_handler Classname + * @return string Returns token fail string. + */ public static function text_fail($token){ $res = self::get($token); if(!\in_array($res['class'], self::$type_handlers)){ diff --git a/token/token_change_email.php b/token/token_change_email.php index ebc519f..ecdd556 100644 --- a/token/token_change_email.php +++ b/token/token_change_email.php @@ -47,10 +47,22 @@ class token_change_email implements token_handler{ return $result; } + /** + * Callback text_fail on fail + * + * @param array $token_data Token Data + * @return string Returns token fail string. + */ public static function text_fail($token_data) { $data = \json_decode($token_data['data'],true); return 'Could NOT change your Account\'s EMail-Address to '.$data['email'].'. Token is expired or invalid.';} + /** + * Callback text_success on success + * + * @param array $token_data Token Data + * @return string Returns token success string. + */ public static function text_success($token_data) { $data = \json_decode($token_data['data'],true); return 'Changed your Account\'s EMail-Address to '.$data['email'].'.';} diff --git a/token/token_confirm_email.php b/token/token_confirm_email.php index 4953040..0d06108 100644 --- a/token/token_confirm_email.php +++ b/token/token_confirm_email.php @@ -46,10 +46,22 @@ class token_confirm_email implements token_handler{ \SYSTEM\SECURITY\security::update_session_data(array('email_confirmed' => 1), $res['session_id']);} return $result; } - + + /** + * Callback text_fail on fail + * + * @param array $token_data Token Data + * @return string Returns token fail string. + */ public static function text_fail($token_data) { return 'Could NOT confirm your EMail-Address. Token is expired or invalid.';} + /** + * Callback text_success on success + * + * @param array $token_data Token Data + * @return string Returns token success string. + */ public static function text_success($token_data) { return 'Confirmed your EMail-Address.';} } \ No newline at end of file diff --git a/token/token_handler.php b/token/token_handler.php index 7cbbe5f..f09ba0d 100644 --- a/token/token_handler.php +++ b/token/token_handler.php @@ -37,7 +37,19 @@ interface token_handler { */ static function confirm($token_data); + /** + * Callback text_success on success + * + * @param array $token_data Token Data + * @return string Returns token success string. + */ static function text_success($token_data); + /** + * Callback text_success on success + * + * @param array $token_data Token Data + * @return string Returns token success string. + */ static function text_fail($token_data); } \ No newline at end of file diff --git a/token/token_reset_password.php b/token/token_reset_password.php index d5bb0bc..f7764f2 100644 --- a/token/token_reset_password.php +++ b/token/token_reset_password.php @@ -41,10 +41,22 @@ class token_reset_password implements token_handler{ public static function confirm($token_data){ $data = \json_decode($token_data['data'],true); return \SYSTEM\SQL\SYS_SECURITY_RESET_PASSWORD::QI(array($data['pw_sha1'],$data['user'])) ? true : false;} - + + /** + * Callback text_fail on fail + * + * @param array $token_data Token Data + * @return string Returns token fail string. + */ public static function text_fail($token_data) { return 'Could NOT reset your Password. Token is expired or invalid.';} + /** + * Callback text_success on success + * + * @param array $token_data Token Data + * @return string Returns token success string. + */ public static function text_success($token_data) { return 'Changed your Password successfully.';} } \ No newline at end of file