diff --git a/src/web_console/authority/admin_auth.js b/src/web_console/authority/admin_auth.js index 90eaa37..6658fa3 100644 --- a/src/web_console/authority/admin_auth.js +++ b/src/web_console/authority/admin_auth.js @@ -3,7 +3,7 @@ * 2015-01-24 */ -require('../minipoem/configuration/constants'); +require('../mini_poem/configuration/constants'); var Cache = require('../mini_poem/cache/redis.js'); var Enums = require('../constants/enums'); var ErrorCode = require('../constants/error_code'); diff --git a/src/web_console/mini_poem/mem/map.js b/src/web_console/mini_poem/mem/map.js new file mode 100644 index 0000000..cd4763d --- /dev/null +++ b/src/web_console/mini_poem/mem/map.js @@ -0,0 +1,120 @@ +/* + * Created by Strawmanbobi + * 2014-08-30 + */ + +function Map() { + this.elements = []; + + this.size = function() { + return this.elements.length; + }; + + this.isEmpty = function() { + return (this.elements.length < 1); + }; + + this.clear = function() { + this.elements = []; + }; + + this.put = function(_key, _value) { + this.elements.push( { + key : _key, + value : _value + }); + }; + + this.remove = function(_key) { + var bln = false; + try { + for (i = 0; i < this.elements.length; i++) { + if (this.elements[i].key == _key) { + this.elements.splice(i, 1); + return true; + } + } + } catch (e) { + bln = false; + } + return bln; + }; + + this.get = function(_key) { + try { + for (i = 0; i < this.elements.length; i++) { + if (this.elements[i].key == _key) { + return this.elements[i].value; + } + } + } catch (e) { + return null; + } + }; + + this.set = function(_key, _value) { + for(i = 0; i < this.elements.length; i++) { + if (this.elements[i].key == _key) { + this.elements[i].value = _value; + return; + } + } + this.elements.push({ + key : _key, + value : _value + }); + }; + + this.element = function(_index) { + if (_index < 0 || _index >= this.elements.length) { + return null; + } + return this.elements[_index]; + }; + + this.containsKey = function(_key) { + var bln = false; + try { + for (i = 0; i < this.elements.length; i++) { + if (this.elements[i].key == _key) { + bln = true; + } + } + } catch (e) { + bln = false; + } + return bln; + }; + + this.containsValue = function(_value) { + var bln = false; + try { + for (i = 0; i < this.elements.length; i++) { + if (this.elements[i].value == _value) { + bln = true; + } + } + } catch (e) { + bln = false; + } + return bln; + }; + + this.values = function() { + var arr = []; + for (i = 0; i < this.elements.length; i++) { + arr.push(this.elements[i].value); + } + return arr; + }; + + this.keys = function() { + var arr = []; + for (i = 0; i < this.elements.length; i++) { + arr.push(this.elements[i].key); + } + return arr; + } +} + +module.exports = Map; \ No newline at end of file diff --git a/src/web_console/script_npm.sh b/src/web_console/script_npm.sh index 3e464ae..e0a14e6 100755 --- a/src/web_console/script_npm.sh +++ b/src/web_console/script_npm.sh @@ -44,4 +44,13 @@ npm install nodemailer@0.7 echo "npm install node-mysql" npm install mysql +echo "npm install redis" +npm install redis + echo "npm install done" + +echo "create logging directory" +mkdir -p logs +mkdir -p logs/production +mkdir -p logs/dev +mkdir -p logs/user_debug diff --git a/src/web_console/web/public_js/script_bower.sh b/src/web_console/web/public_js/script_bower.sh old mode 100644 new mode 100755 index 9554fed..edf4e59 --- a/src/web_console/web/public_js/script_bower.sh +++ b/src/web_console/web/public_js/script_bower.sh @@ -3,7 +3,7 @@ echo "running script of bower install needed by irext..." echo "npm install bower -g" -npm install bower -g +sudo npm install bower -g echo "bower install toastr" bower install toastr --allow-root @@ -20,4 +20,4 @@ bower install select2 --allow-root echo "bower install bootstrap-spinner" bower install bootstrap-spinner --allow-root -echo "bower install done" \ No newline at end of file +echo "bower install done" diff --git a/src/web_console/work_unit/certificate_logic.js b/src/web_console/work_unit/certificate_logic.js index d760e30..f9165ec 100644 --- a/src/web_console/work_unit/certificate_logic.js +++ b/src/web_console/work_unit/certificate_logic.js @@ -7,7 +7,7 @@ var Constants = require('../mini_poem/configuration/constants'); var Admin = require('../model/admin_dao.js'); var AdminAuth = require('../authority/admin_auth.js'); -var MD5 = require('../mini_poem/security/md5.js'); +var MD5 = require('../mini_poem/crypto/md5.js'); var StringUtils = require('../mini_poem/utils/string_utils.js'); var nodemailer = require('nodemailer');