From b99cc3e2080475491cd86d804f8c9aa7edfbe78c Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 13 Jun 2016 11:07:58 +0200 Subject: [PATCH] #3 docu sai --- sai/js/crypto/jquery.md5.js | 269 ------------------ sai/js/crypto/jquery.sha1.js | 170 ----------- .../saimod_sys_api/qq/SYS_SAIMOD_API_ADD.php | 10 + .../saimod_sys_api/qq/SYS_SAIMOD_API_DEL.php | 10 + .../saimod_sys_api/qq/SYS_SAIMOD_API_GET.php | 10 + .../qq/SYS_SAIMOD_API_GROUPS.php | 10 + .../qq/SYS_SAIMOD_API_SINGLE_SELECT.php | 10 + sai/modules/saimod_sys_api/saimod_sys_api.php | 10 + .../saimod_sys_cache/qq/SYS_SAIMOD_CACHE.php | 10 + .../qq/SYS_SAIMOD_CACHE_CLEAR.php | 10 + .../qq/SYS_SAIMOD_CACHE_COUNT.php | 10 + .../saimod_sys_cache/saimod_sys_cache.php | 10 + sai/modules/saimod_sys_config/autoload.inc | 2 +- sai/modules/saimod_sys_config/qq/dummy | 0 .../saimod_sys_config/saimod_sys_config.php | 10 + .../saimod_sys_cron/qq/SYS_SAIMOD_CRON.php | 10 + .../qq/SYS_SAIMOD_CRON_ADD.php | 10 + .../qq/SYS_SAIMOD_CRON_CHANGE.php | 10 + .../qq/SYS_SAIMOD_CRON_DEL.php | 10 + .../qq/SYS_SAIMOD_CRON_SINGLE_SELECT.php | 10 + .../saimod_sys_cron/saimod_sys_cron.php | 10 + sai/modules/saimod_sys_docu/autoload.inc | 2 +- sai/modules/saimod_sys_docu/qq/dummy | 0 .../saimod_sys_docu/saimod_sys_docu.php | 10 + sai/modules/saimod_sys_files/autoload.inc | 2 +- sai/modules/saimod_sys_files/qq/dummy | 0 .../saimod_sys_files/saimod_sys_files.php | 10 + sai/modules/saimod_sys_git/autoload.inc | 2 +- sai/modules/saimod_sys_git/qq/dummy | 0 sai/modules/saimod_sys_git/saimod_sys_git.php | 10 + .../saimod_sys_langswitcher.php | 10 + .../qq/SYS_SAIMOD_LOG_ANALYTICS.php | 10 + .../qq/SYS_SAIMOD_LOG_BASIC_QUERYTIME.php | 10 + .../qq/SYS_SAIMOD_LOG_BASIC_SUCCESS.php | 10 + .../qq/SYS_SAIMOD_LOG_BASIC_VISITOR.php | 10 + .../qq/SYS_SAIMOD_LOG_CLASS_BASIC.php | 10 + .../qq/SYS_SAIMOD_LOG_CLASS_OTHER.php | 10 + .../qq/SYS_SAIMOD_LOG_CLASS_SYSTEM.php | 10 + .../qq/SYS_SAIMOD_LOG_ERROR.php | 10 + .../qq/SYS_SAIMOD_LOG_FILTER.php | 10 + .../qq/SYS_SAIMOD_LOG_FILTERS.php | 10 + .../qq/SYS_SAIMOD_LOG_FILTER_COUNT.php | 10 + .../qq/SYS_SAIMOD_LOG_TRUNCATE.php | 10 + .../qq/SYS_SAIMOD_LOG_UNIQUE_BASIC.php | 10 + .../qq/SYS_SAIMOD_LOG_UNIQUE_EXCEPTION.php | 10 + .../qq/SYS_SAIMOD_LOG_UNIQUE_REFERER.php | 10 + .../qq/SYS_SAIMOD_LOG_UNIQUE_REQUEST.php | 10 + sai/modules/saimod_sys_log/saimod_sys_log.php | 10 + sai/modules/saimod_sys_login/autoload.inc | 2 +- sai/modules/saimod_sys_login/qq/dummy | 0 .../saimod_sys_login/saimod_sys_login.php | 10 + sai/modules/saimod_sys_mod/autoload.inc | 2 +- sai/modules/saimod_sys_mod/qq/dummy | 0 sai/modules/saimod_sys_mod/saimod_sys_mod.php | 10 + .../qq/SYS_SAIMOD_PAGE_ADD.php | 10 + .../qq/SYS_SAIMOD_PAGE_DEL.php | 10 + .../qq/SYS_SAIMOD_PAGE_GET.php | 10 + .../qq/SYS_SAIMOD_PAGE_GROUPS.php | 10 + .../qq/SYS_SAIMOD_PAGE_SINGLE_SELECT.php | 10 + .../saimod_sys_page/saimod_sys_page.php | 10 + .../qq/SYS_SAIMOD_SECURITY_DELETE_USER.php | 10 + ...SYS_SAIMOD_SECURITY_DELETE_USER_RIGHTS.php | 10 + .../qq/SYS_SAIMOD_SECURITY_RENAME_USER.php | 10 + .../qq/SYS_SAIMOD_SECURITY_RIGHTS.php | 10 + .../qq/SYS_SAIMOD_SECURITY_RIGHT_CHECK.php | 10 + .../qq/SYS_SAIMOD_SECURITY_RIGHT_DELETE.php | 10 + .../qq/SYS_SAIMOD_SECURITY_RIGHT_INSERT.php | 10 + .../qq/SYS_SAIMOD_SECURITY_USER.php | 13 +- .../qq/SYS_SAIMOD_SECURITY_USERS.php | 10 + .../qq/SYS_SAIMOD_SECURITY_USERS_FILTER.php | 10 + .../qq/SYS_SAIMOD_SECURITY_USER_COUNT.php | 10 + .../SYS_SAIMOD_SECURITY_USER_COUNT_FILTER.php | 10 + .../qq/SYS_SAIMOD_SECURITY_USER_LOG.php | 10 + .../qq/SYS_SAIMOD_SECURITY_USER_LOG_COUNT.php | 10 + .../qq/SYS_SAIMOD_SECURITY_USER_RIGHTS.php | 10 + .../SYS_SAIMOD_SECURITY_USER_RIGHT_CHECK.php | 10 + .../SYS_SAIMOD_SECURITY_USER_RIGHT_DELETE.php | 10 + .../SYS_SAIMOD_SECURITY_USER_RIGHT_INSERT.php | 10 + .../saimod_sys_security.php | 10 + .../qq/SYS_SAIMOD_TEXT_COUNT.php | 10 + .../qq/SYS_SAIMOD_TEXT_COUNT_FILTER.php | 10 + .../qq/SYS_SAIMOD_TEXT_COUNT_NOTAG.php | 10 + .../qq/SYS_SAIMOD_TEXT_COUNT_NOTAG_FILTER.php | 10 + .../qq/SYS_SAIMOD_TEXT_COUNT_TAG.php | 10 + .../qq/SYS_SAIMOD_TEXT_COUNT_TAG_FILTER.php | 10 + .../qq/SYS_SAIMOD_TEXT_TAGS.php | 10 + .../qq/SYS_SAIMOD_TEXT_TEXT.php | 10 + .../qq/SYS_SAIMOD_TEXT_TEXT_FILTER.php | 10 + .../qq/SYS_SAIMOD_TEXT_TEXT_NOTAG.php | 10 + .../qq/SYS_SAIMOD_TEXT_TEXT_NOTAG_FILTER.php | 10 + .../qq/SYS_SAIMOD_TEXT_TEXT_TAG.php | 10 + .../qq/SYS_SAIMOD_TEXT_TEXT_TAG_FILTER.php | 10 + .../saimod_sys_text/saimod_sys_text.php | 10 + .../qq/SYS_SAIMOD_TODO_ASSIGN.php | 10 + .../qq/SYS_SAIMOD_TODO_ASSIGNEES.php | 10 + .../qq/SYS_SAIMOD_TODO_CLOSE.php | 10 + .../qq/SYS_SAIMOD_TODO_CLOSE_ALL.php | 10 + .../qq/SYS_SAIMOD_TODO_COUNT.php | 10 + .../qq/SYS_SAIMOD_TODO_COUNT_FREE.php | 10 + .../qq/SYS_SAIMOD_TODO_COUNT_MINE.php | 10 + .../qq/SYS_SAIMOD_TODO_COUNT_OTHERS.php | 10 + .../qq/SYS_SAIMOD_TODO_COUNT_TYPE.php | 10 + .../qq/SYS_SAIMOD_TODO_DEASSIGN.php | 10 + .../qq/SYS_SAIMOD_TODO_EDIT.php | 10 + .../qq/SYS_SAIMOD_TODO_EXCEPTION_INSERT.php | 10 + .../qq/SYS_SAIMOD_TODO_LIST.php | 10 + .../qq/SYS_SAIMOD_TODO_LIST_FREE.php | 10 + .../qq/SYS_SAIMOD_TODO_LIST_MINE.php | 10 + .../qq/SYS_SAIMOD_TODO_LIST_OTHERS.php | 10 + .../qq/SYS_SAIMOD_TODO_LIST_TYPE.php | 10 + .../qq/SYS_SAIMOD_TODO_OPEN.php | 10 + .../qq/SYS_SAIMOD_TODO_PRIORITY.php | 10 + .../qq/SYS_SAIMOD_TODO_STATS_ASSIGNED.php | 10 + .../qq/SYS_SAIMOD_TODO_STATS_CLOSED.php | 10 + .../SYS_SAIMOD_TODO_STATS_COUNT_DOTO_GEN.php | 10 + ...YS_SAIMOD_TODO_STATS_COUNT_DOTO_REPORT.php | 10 + .../SYS_SAIMOD_TODO_STATS_COUNT_DOTO_USER.php | 10 + .../SYS_SAIMOD_TODO_STATS_COUNT_TODO_GEN.php | 10 + ...MOD_TODO_STATS_COUNT_TODO_NOT_ASSIGNED.php | 10 + ...YS_SAIMOD_TODO_STATS_COUNT_TODO_REPORT.php | 10 + .../SYS_SAIMOD_TODO_STATS_COUNT_TODO_USER.php | 10 + .../qq/SYS_SAIMOD_TODO_STATS_USERS.php | 10 + .../qq/SYS_SAIMOD_TODO_TODO.php | 10 + .../saimod_sys_todo/saimod_sys_todo.php | 10 + sai/modules/saimod_sys_todo/todo_stats.php | 10 + .../saimod_sys_todo/todo_stats_data.php | 10 + sai/modules/saistart_sys_sai/autoload.inc | 2 +- sai/modules/saistart_sys_sai/qq/dummy | 0 .../saistart_sys_sai/saistart_sys_sai.php | 10 + sai/page/default_page.php | 46 ++- sai/sai/SaiModule.php | 75 ++++- sai/sai/sai.php | 69 ++++- sai/sai/saigui.php | 20 ++ 133 files changed, 1337 insertions(+), 459 deletions(-) delete mode 100644 sai/js/crypto/jquery.md5.js delete mode 100644 sai/js/crypto/jquery.sha1.js delete mode 100644 sai/modules/saimod_sys_config/qq/dummy delete mode 100644 sai/modules/saimod_sys_docu/qq/dummy delete mode 100644 sai/modules/saimod_sys_files/qq/dummy delete mode 100644 sai/modules/saimod_sys_git/qq/dummy delete mode 100644 sai/modules/saimod_sys_login/qq/dummy delete mode 100644 sai/modules/saimod_sys_mod/qq/dummy delete mode 100644 sai/modules/saistart_sys_sai/qq/dummy diff --git a/sai/js/crypto/jquery.md5.js b/sai/js/crypto/jquery.md5.js deleted file mode 100644 index bf9bbe9..0000000 --- a/sai/js/crypto/jquery.md5.js +++ /dev/null @@ -1,269 +0,0 @@ -/* - * jQuery MD5 Plugin 1.2.1 - * https://github.com/blueimp/jQuery-MD5 - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://creativecommons.org/licenses/MIT/ - * - * Based on - * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message - * Digest Algorithm, as defined in RFC 1321. - * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for more info. - */ - -/*jslint bitwise: true */ -/*global unescape, jQuery */ - -(function ($) { - 'use strict'; - - /* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ - function safe_add(x, y) { - var lsw = (x & 0xFFFF) + (y & 0xFFFF), - msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); - } - - /* - * Bitwise rotate a 32-bit number to the left. - */ - function bit_rol(num, cnt) { - return (num << cnt) | (num >>> (32 - cnt)); - } - - /* - * These functions implement the four basic operations the algorithm uses. - */ - function md5_cmn(q, a, b, x, s, t) { - return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); - } - function md5_ff(a, b, c, d, x, s, t) { - return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); - } - function md5_gg(a, b, c, d, x, s, t) { - return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); - } - function md5_hh(a, b, c, d, x, s, t) { - return md5_cmn(b ^ c ^ d, a, b, x, s, t); - } - function md5_ii(a, b, c, d, x, s, t) { - return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); - } - - /* - * Calculate the MD5 of an array of little-endian words, and a bit length. - */ - function binl_md5(x, len) { - /* append padding */ - x[len >> 5] |= 0x80 << ((len) % 32); - x[(((len + 64) >>> 9) << 4) + 14] = len; - - var i, olda, oldb, oldc, oldd, - a = 1732584193, - b = -271733879, - c = -1732584194, - d = 271733878; - - for (i = 0; i < x.length; i += 16) { - olda = a; - oldb = b; - oldc = c; - oldd = d; - - a = md5_ff(a, b, c, d, x[i], 7, -680876936); - d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); - c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); - b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); - a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); - d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); - c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); - b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); - a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); - d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); - c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); - b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); - a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); - d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); - c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); - b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); - - a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); - d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); - c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); - b = md5_gg(b, c, d, a, x[i], 20, -373897302); - a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); - d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); - c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); - b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); - a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); - d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); - c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); - b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); - a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); - d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); - c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); - b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); - - a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); - d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); - c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); - b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); - a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); - d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); - c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); - b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); - a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); - d = md5_hh(d, a, b, c, x[i], 11, -358537222); - c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); - b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); - a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); - d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); - c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); - b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); - - a = md5_ii(a, b, c, d, x[i], 6, -198630844); - d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); - c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); - b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); - a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); - d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); - c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); - b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); - a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); - d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); - c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); - b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); - a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); - d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); - c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); - b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - } - return [a, b, c, d]; - } - - /* - * Convert an array of little-endian words to a string - */ - function binl2rstr(input) { - var i, - output = ''; - for (i = 0; i < input.length * 32; i += 8) { - output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF); - } - return output; - } - - /* - * Convert a raw string to an array of little-endian words - * Characters >255 have their high-byte silently ignored. - */ - function rstr2binl(input) { - var i, - output = []; - output[(input.length >> 2) - 1] = undefined; - for (i = 0; i < output.length; i += 1) { - output[i] = 0; - } - for (i = 0; i < input.length * 8; i += 8) { - output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32); - } - return output; - } - - /* - * Calculate the MD5 of a raw string - */ - function rstr_md5(s) { - return binl2rstr(binl_md5(rstr2binl(s), s.length * 8)); - } - - /* - * Calculate the HMAC-MD5, of a key and some data (raw strings) - */ - function rstr_hmac_md5(key, data) { - var i, - bkey = rstr2binl(key), - ipad = [], - opad = [], - hash; - ipad[15] = opad[15] = undefined; - if (bkey.length > 16) { - bkey = binl_md5(bkey, key.length * 8); - } - for (i = 0; i < 16; i += 1) { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } - hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8); - return binl2rstr(binl_md5(opad.concat(hash), 512 + 128)); - } - - /* - * Convert a raw string to a hex string - */ - function rstr2hex(input) { - var hex_tab = '0123456789abcdef', - output = '', - x, - i; - for (i = 0; i < input.length; i += 1) { - x = input.charCodeAt(i); - output += hex_tab.charAt((x >>> 4) & 0x0F) + - hex_tab.charAt(x & 0x0F); - } - return output; - } - - /* - * Encode a string as utf-8 - */ - function str2rstr_utf8(input) { - return unescape(encodeURIComponent(input)); - } - - /* - * Take string arguments and return either raw or hex encoded strings - */ - function raw_md5(s) { - return rstr_md5(str2rstr_utf8(s)); - } - function hex_md5(s) { - return rstr2hex(raw_md5(s)); - } - function raw_hmac_md5(k, d) { - return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)); - } - function hex_hmac_md5(k, d) { - return rstr2hex(raw_hmac_md5(k, d)); - } - - $.md5 = function (string, key, raw) { - if (!key) { - if (!raw) { - return hex_md5(string); - } else { - return raw_md5(string); - } - } - if (!raw) { - return hex_hmac_md5(key, string); - } else { - return raw_hmac_md5(key, string); - } - }; - -}(typeof jQuery === 'function' ? jQuery : this)); \ No newline at end of file diff --git a/sai/js/crypto/jquery.sha1.js b/sai/js/crypto/jquery.sha1.js deleted file mode 100644 index 40c5725..0000000 --- a/sai/js/crypto/jquery.sha1.js +++ /dev/null @@ -1,170 +0,0 @@ - -/** - * jQuery SHA1 hash algorithm function - * - * - * Calculate the sha1 hash of a String - * String $.sha1 ( String str ) - * - * - * Calculates the sha1 hash of str using the US Secure Hash Algorithm 1. - * SHA-1 the Secure Hash Algorithm (SHA) was developed by NIST and is specified in the Secure Hash Standard (SHS, FIPS 180). - * This script is used to process variable length message into a fixed-length output using the SHA-1 algorithm. It is fully compatible with UTF-8 encoding. - * If you plan using UTF-8 encoding in your project don't forget to set the page encoding to UTF-8 (Content-Type meta tag). - * This function orginally get from the WebToolkit and rewrite for using as the jQuery plugin. - * - * Example - * Code - * - * $.sha1("I'm Persian."); - * - * Result - * - * "1d302f9dc925d62fc859055999d2052e274513ed" - * - * - * @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com > - * @link http://www.semnanweb.com/jquery-plugin/sha1.html - * @see http://www.webtoolkit.info/ - * @license http://www.gnu.org/licenses/gpl.html [GNU General Public License] - * @param {jQuery} {sha1:function(string)) - * @return string - */ - -(function($){ - - var rotateLeft = function(lValue, iShiftBits) { - return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); - } - - var lsbHex = function(value) { - var string = ""; - var i; - var vh; - var vl; - for(i = 0;i <= 6;i += 2) { - vh = (value>>>(i * 4 + 4))&0x0f; - vl = (value>>>(i*4))&0x0f; - string += vh.toString(16) + vl.toString(16); - } - return string; - }; - - var cvtHex = function(value) { - var string = ""; - var i; - var v; - for(i = 7;i >= 0;i--) { - v = (value>>>(i * 4))&0x0f; - string += v.toString(16); - } - return string; - }; - - var uTF8Encode = function(string) { - string = string.replace(/\x0d\x0a/g, "\x0a"); - var output = ""; - for (var n = 0; n < string.length; n++) { - var c = string.charCodeAt(n); - if (c < 128) { - output += String.fromCharCode(c); - } else if ((c > 127) && (c < 2048)) { - output += String.fromCharCode((c >> 6) | 192); - output += String.fromCharCode((c & 63) | 128); - } else { - output += String.fromCharCode((c >> 12) | 224); - output += String.fromCharCode(((c >> 6) & 63) | 128); - output += String.fromCharCode((c & 63) | 128); - } - } - return output; - }; - - $.extend({ - sha1: function(string) { - var blockstart; - var i, j; - var W = new Array(80); - var H0 = 0x67452301; - var H1 = 0xEFCDAB89; - var H2 = 0x98BADCFE; - var H3 = 0x10325476; - var H4 = 0xC3D2E1F0; - var A, B, C, D, E; - var tempValue; - string = uTF8Encode(string); - var stringLength = string.length; - var wordArray = new Array(); - for(i = 0;i < stringLength - 3;i += 4) { - j = string.charCodeAt(i)<<24 | string.charCodeAt(i + 1)<<16 | string.charCodeAt(i + 2)<<8 | string.charCodeAt(i + 3); - wordArray.push(j); - } - switch(stringLength % 4) { - case 0: - i = 0x080000000; - break; - case 1: - i = string.charCodeAt(stringLength - 1)<<24 | 0x0800000; - break; - case 2: - i = string.charCodeAt(stringLength - 2)<<24 | string.charCodeAt(stringLength - 1)<<16 | 0x08000; - break; - case 3: - i = string.charCodeAt(stringLength - 3)<<24 | string.charCodeAt(stringLength - 2)<<16 | string.charCodeAt(stringLength - 1)<<8 | 0x80; - break; - } - wordArray.push(i); - while((wordArray.length % 16) != 14 ) wordArray.push(0); - wordArray.push(stringLength>>>29); - wordArray.push((stringLength<<3)&0x0ffffffff); - for(blockstart = 0;blockstart < wordArray.length;blockstart += 16) { - for(i = 0;i < 16;i++) W[i] = wordArray[blockstart+i]; - for(i = 16;i <= 79;i++) W[i] = rotateLeft(W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16], 1); - A = H0; - B = H1; - C = H2; - D = H3; - E = H4; - for(i = 0;i <= 19;i++) { - tempValue = (rotateLeft(A, 5) + ((B&C) | (~B&D)) + E + W[i] + 0x5A827999) & 0x0ffffffff; - E = D; - D = C; - C = rotateLeft(B, 30); - B = A; - A = tempValue; - } - for(i = 20;i <= 39;i++) { - tempValue = (rotateLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0x6ED9EBA1) & 0x0ffffffff; - E = D; - D = C; - C = rotateLeft(B, 30); - B = A; - A = tempValue; - } - for(i = 40;i <= 59;i++) { - tempValue = (rotateLeft(A, 5) + ((B&C) | (B&D) | (C&D)) + E + W[i] + 0x8F1BBCDC) & 0x0ffffffff; - E = D; - D = C; - C = rotateLeft(B, 30); - B = A; - A = tempValue; - } - for(i = 60;i <= 79;i++) { - tempValue = (rotateLeft(A, 5) + (B ^ C ^ D) + E + W[i] + 0xCA62C1D6) & 0x0ffffffff; - E = D; - D = C; - C = rotateLeft(B, 30); - B = A; - A = tempValue; - } - H0 = (H0 + A) & 0x0ffffffff; - H1 = (H1 + B) & 0x0ffffffff; - H2 = (H2 + C) & 0x0ffffffff; - H3 = (H3 + D) & 0x0ffffffff; - H4 = (H4 + E) & 0x0ffffffff; - } - var tempValue = cvtHex(H0) + cvtHex(H1) + cvtHex(H2) + cvtHex(H3) + cvtHex(H4); - return tempValue.toLowerCase(); - } - }); -})(jQuery); \ No newline at end of file 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 94e2292..d6ffac1 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,4 +1,14 @@ WEBPATH(false)). \SYSTEM\HTML\html::link(\LIB\lib_tablesorter::css()->WEBPATH(false)). @@ -39,6 +73,11 @@ class default_page implements \SYSTEM\PAGE\DefaultPage { new \SYSTEM\PSAI('page/css/sai.css')))); } + /** + * Get js links for the Default Page + * + * @return string Returns html of the Sai js includes + */ public static function js(){ return \SYSTEM\HTML\html::script(\LIB\lib_jquery::js()->WEBPATH()). \SYSTEM\HTML\html::script(\LIB\lib_bootstrap::js()->WEBPATH()). @@ -52,6 +91,11 @@ class default_page implements \SYSTEM\PAGE\DefaultPage { ''; } + /** + * Get Sai Default Page HTML + * + * @return string Returns html of the Sai Default Page + */ public function html($_escaped_fragment_ = NULL){ $vars = array(); $vars['css'] = self::css(); diff --git a/sai/sai/SaiModule.php b/sai/sai/SaiModule.php index 45c3bba..b9ae74a 100644 --- a/sai/sai/SaiModule.php +++ b/sai/sai/SaiModule.php @@ -1,11 +1,39 @@ html($_escaped_fragment_);} + + /** + * Generate the
  • menu for the Saimod + * Override this + * + * @return string Returns HTML of the
  • menu for the Saimod + */ public static function html_li_menu(){ throw new \RuntimeException("Unimplemented!");} - //true or false -> if true no call to right_right() + /** + * Check public state for the Saimod. + * Override this + * + * @return bool Returns true if the saimod is public + */ public static function right_public(){ throw new \RuntimeException("Unimplemented!");} - //check your rights here -> returns true or false + + /** + * Check rights for the Saimod. + * Override this + * + * @return bool Returns true if accessable for the user else false + */ public static function right_right(){ throw new \RuntimeException("Unimplemented!");} - } \ No newline at end of file diff --git a/sai/sai/sai.php b/sai/sai/sai.php index d109416..810d76b 100644 --- a/sai/sai/sai.php +++ b/sai/sai/sai.php @@ -1,37 +1,102 @@ html() + */ class saigui { + /** string field in post or get to be read as saimod modifier */ const SAI_MOD_POSTFIELD = 'sai_mod'; + /** + * Generate the HTML for the SAI Userinterface + * + * @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',