diff --git a/cli.php b/cli.php index 09ea1f51..372a5850 100755 --- a/cli.php +++ b/cli.php @@ -1,3 +1,4 @@ +#!/usr/bin/php -q run (); -?> diff --git a/copyright.txt b/copyright.txt index 9b26e8d1..22b7a680 100755 --- a/copyright.txt +++ b/copyright.txt @@ -1,4 +1,4 @@ -Copyright (C) 2015 - Juan Ferrer Toribio +Copyright (C) 2016 - Juan Ferrer Toribio This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/environ.php b/environ.php index 74e1f384..7d9b0127 100644 --- a/environ.php +++ b/environ.php @@ -1,13 +1,13 @@ + + + + SELECT length, nAlpha, nUpper, nDigits, nPunct + FROM account.userPassword + + + - SELECT id, u.name, email, mail, c.user_id, c.default_address - FROM user_view u + SELECT u.id, u.name, u.hasPassword, + c.email, c.mail, c.user_id, c.default_address + FROM account.userView u LEFT JOIN customer_view c ON u.id = c.user_id @@ -28,6 +37,10 @@ icon="place" tip="_Addresses" on-click="onAddressesClick"/> +
@@ -36,19 +49,6 @@
-
- - - -
@@ -60,4 +60,62 @@
+ +
+
+ + + +
+ + +
+
+ + +
+

+ Password requirements +

+
    +
  • + + characters long +
  • +
  • + + alphabetic characters +
  • +
  • + + capital letters +
  • +
  • + + digits +
  • +
  • + + symbols +
  • +
+
+
diff --git a/forms/admin/photos/photos.js b/forms/admin/photos/photos.js index 833273de..9da93fe3 100644 --- a/forms/admin/photos/photos.js +++ b/forms/admin/photos/photos.js @@ -22,18 +22,16 @@ Hedera.Photos = new Class this._onResponse.bind (this)); } - ,_onResponse: function (request, json, error) + ,_onResponse: function (json, error) { this.$('submit').disabled = false; - if (json) - { - this.$('photo-id').value = ''; - this.$('photo-id').focus (); - Htk.Toast.showMessage (_('ImageAdded')); - } - else - Htk.Toast.showError (error.message); + if (error) + throw error; + + this.$('photo-id').value = ''; + this.$('photo-id').focus (); + Htk.Toast.showMessage (_('ImageAdded')); } }); diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index f9b61315..42411871 100755 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -152,7 +152,6 @@ directory="catalog" subdir="200x200" form="item" - conn="conn" column="Foto" full-dir="900x900"/>
@@ -420,6 +419,7 @@ form="card" column="Foto" full-dir="900x900" + conn="conn" editable="true"/>

diff --git a/js/db/connection.js b/js/db/connection.js index 3a1e2780..be4785cc 100644 --- a/js/db/connection.js +++ b/js/db/connection.js @@ -127,17 +127,8 @@ Connection.implement error = e; } - if (error) - this.signalEmit ('error', error); - if (callback) - try { callback (new Db.ResultSet (json, error)); - } - catch (e) - { - this.signalEmit ('error', e); - } } }); diff --git a/js/db/model.js b/js/db/model.js index c0c5d92b..2df10aee 100644 --- a/js/db/model.js +++ b/js/db/model.js @@ -324,38 +324,43 @@ Model.implement this._cleanData (); - for (var i = 0; result = resultSet.fetchResult (); i++) + try { + for (var i = 0; result = resultSet.fetchResult (); i++) if (i == this._resultIndex) dataResult = result; - if (dataResult && typeof dataResult === 'object') - { - this.data = dataResult.data; - this.tables = dataResult.tables; - this.columns = dataResult.columns; - this.columnMap = dataResult.columnMap; - this._repairColumns (); - this._refreshRowIndexes (0); - this._refreshMainTable (); - - for (column in this._requestedIndexes) - this._buildIndex (column); - - var sortColumn = -1; - - if (this._requestedSortName) - sortColumn = this.getColumnIndex (this._requestedSortName); - else if (this._requestedSortIndex !== -1 - && this.checkColExists (this._requestedSortIndex)) - sortColumn = this._requestedSortIndex; - - if (sortColumn !== -1) - this._realSort (sortColumn, this._sortWay); - - this._setStatus (Status.READY); + if (!dataResult || typeof dataResult !== 'object') + throw new Error ('The provided statement doesn\'t return a result set'); } - else + catch (e) + { this._setStatus (Status.ERROR); + throw e; + } + + this.data = dataResult.data; + this.tables = dataResult.tables; + this.columns = dataResult.columns; + this.columnMap = dataResult.columnMap; + this._repairColumns (); + this._refreshRowIndexes (0); + this._refreshMainTable (); + + for (column in this._requestedIndexes) + this._buildIndex (column); + + var sortColumn = -1; + + if (this._requestedSortName) + sortColumn = this.getColumnIndex (this._requestedSortName); + else if (this._requestedSortIndex !== -1 + && this.checkColExists (this._requestedSortIndex)) + sortColumn = this._requestedSortIndex; + + if (sortColumn !== -1) + this._realSort (sortColumn, this._sortWay); + + this._setStatus (Status.READY); } ,_refreshRowIndexes: function (start) diff --git a/js/db/result-set.js b/js/db/result-set.js index 9ec01e0f..23d528d5 100644 --- a/js/db/result-set.js +++ b/js/db/result-set.js @@ -30,6 +30,9 @@ module.exports = new Class ,fetch: function () { + if (this.error) + throw this.error; + if (this.results !== null && this.results.length > 0) return this.results.shift (); diff --git a/js/htk/field/image.js b/js/htk/field/image.js index 7895d7e2..a148f81e 100644 --- a/js/htk/field/image.js +++ b/js/htk/field/image.js @@ -181,7 +181,7 @@ module.exports = new Class ,_onEditClick: function (event) { event.stopPropagation (); - + var editor = new Htk.ImageEditor ({conn: this.conn}); editor.setData (this.value, this._directory); editor.on ('name-changed', this._onNameChange, this); diff --git a/js/htk/image-editor.js b/js/htk/image-editor.js index 86f71b1e..239092fe 100644 --- a/js/htk/image-editor.js +++ b/js/htk/image-editor.js @@ -51,18 +51,16 @@ module.exports = new Class this._onResponse.bind (this)); } - ,_onResponse: function (request, json, error) + ,_onResponse: function (json, error) { this.$('submit').disabled = false; this.$('spinner').stop (); - if (json) - { - Toast.showMessage (_('ImageAdded')); - this.signalEmit ('file-uploaded', this.$('name').value); - } - else - Toast.showError (error.message); + if (error) + throw error; + + Toast.showMessage (_('ImageAdded')); + this.signalEmit ('file-uploaded', this.$('name').value); } ,setData: function (image, directory) diff --git a/js/vn/json-connection.js b/js/vn/json-connection.js index 6782804f..f8bfef99 100644 --- a/js/vn/json-connection.js +++ b/js/vn/json-connection.js @@ -281,10 +281,18 @@ module.exports = new Class error = e; } + if (callback) + try { + callback (data, error); + error = null; + } + catch (e) + { + error = e; + } + if (error) this.signalEmit ('error', error); - if (callback) - callback (data, error); } }); diff --git a/package.json b/package.json index 30d5e60d..cbc1fe1e 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,8 @@ "devDependencies": { "webpack": "*", "webpack-dev-server": "*", - "split-by-name-webpack-plugin": "*", "css-loader": "*", "style-loader": "*", - "file-loader": "*", "json-loader": "*", "raw-loader": "*", "bundle-loader": "*" diff --git a/pages/main/analytics.php b/pages/main/analytics.html similarity index 100% rename from pages/main/analytics.php rename to pages/main/analytics.html diff --git a/pages/main/head.php b/pages/main/head.php index 67183340..f5309dee 100755 --- a/pages/main/head.php +++ b/pages/main/head.php @@ -12,12 +12,12 @@ if ($result = $db->query ('SELECT name, content FROM metatag')) $result->free (); } -if (_DEBUG_MODE) +if (_DEV_MODE) { - $this->includeJs ('http://localhost:8080/webpack-dev-server.js'); - $this->includeJs ('http://localhost:8080/build/hedera-web.js'); + $url = 'http://localhost:8080'; + $this->includeJs ("$url/webpack-dev-server.js"); + $this->includeJs ("$url/build/hedera-web.js"); } else $this->includeJs ('build/hedera-web.js'); -?> diff --git a/php-test b/php-test deleted file mode 100755 index 267e94bd..00000000 --- a/php-test +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -php5 -d auto_prepend_file=configure.php "$@" diff --git a/reports/recover-password/index.php b/reports/recover-password/index.php new file mode 100755 index 00000000..ddfcab29 --- /dev/null +++ b/reports/recover-password/index.php @@ -0,0 +1,11 @@ + + + + Recover password + + + + Recover password + + + diff --git a/rest/core/captcha.php b/rest/core/captcha.php index 8213d4f9..c3fb6d67 100755 --- a/rest/core/captcha.php +++ b/rest/core/captcha.php @@ -45,4 +45,3 @@ class Captcha extends Vn\Web\RestRequest } } -?> diff --git a/rest/core/log.php b/rest/core/log.php index 4d90bcee..a0208251 100755 --- a/rest/core/log.php +++ b/rest/core/log.php @@ -23,4 +23,3 @@ class Log extends Vn\Web\JsonRequest } } -?> diff --git a/rest/core/login.php b/rest/core/login.php index dee21a0a..7299cb18 100755 --- a/rest/core/login.php +++ b/rest/core/login.php @@ -91,4 +91,3 @@ class Login extends Vn\Web\JsonRequest } } -?> diff --git a/rest/core/logout.php b/rest/core/logout.php index 1b28f756..ad4b8945 100755 --- a/rest/core/logout.php +++ b/rest/core/logout.php @@ -9,4 +9,3 @@ class Logout extends Vn\Web\JsonRequest } } -?> diff --git a/rest/core/query.php b/rest/core/query.php index 123eb044..a1641e43 100755 --- a/rest/core/query.php +++ b/rest/core/query.php @@ -213,4 +213,3 @@ class Query extends Vn\Web\JsonRequest } -?> diff --git a/rest/core/recover-password.php b/rest/core/recover-password.php index 7c84e73f..43f110ca 100755 --- a/rest/core/recover-password.php +++ b/rest/core/recover-password.php @@ -61,4 +61,3 @@ class RecoverPassword extends Vn\Web\JsonRequest } } -?> diff --git a/rest/core/supplant.php b/rest/core/supplant.php index cc0b4377..a7cf0ea1 100755 --- a/rest/core/supplant.php +++ b/rest/core/supplant.php @@ -10,4 +10,3 @@ class Supplant extends Vn\Web\JsonRequest } } -?> diff --git a/rest/dms/add.php b/rest/dms/add.php index 9b2ed09c..19a51740 100644 --- a/rest/dms/add.php +++ b/rest/dms/add.php @@ -109,4 +109,3 @@ class Add extends Vn\Web\JsonRequest } } -?> diff --git a/rest/dms/invoice.php b/rest/dms/invoice.php index 558103e8..78548d38 100644 --- a/rest/dms/invoice.php +++ b/rest/dms/invoice.php @@ -20,4 +20,3 @@ class Invoice extends Vn\Web\RestRequest } } -?> diff --git a/rest/edi/clean.php b/rest/edi/clean.php index 7db0b060..a7e4858f 100644 --- a/rest/edi/clean.php +++ b/rest/edi/clean.php @@ -43,4 +43,3 @@ class Clean extends Edi\Method } } -?> diff --git a/rest/edi/lib/message.php b/rest/edi/lib/message.php index e7d886ad..73dc6823 100644 --- a/rest/edi/lib/message.php +++ b/rest/edi/lib/message.php @@ -162,4 +162,3 @@ class Message } } -?> diff --git a/rest/edi/lib/method.php b/rest/edi/lib/method.php index c8f776fe..58551139 100644 --- a/rest/edi/lib/method.php +++ b/rest/edi/lib/method.php @@ -42,4 +42,3 @@ abstract class Method extends \Vn\Lib\Method } } -?> diff --git a/rest/edi/lib/section.php b/rest/edi/lib/section.php index 677384bb..abef926a 100644 --- a/rest/edi/lib/section.php +++ b/rest/edi/lib/section.php @@ -25,4 +25,3 @@ class Section } } -?> diff --git a/rest/edi/lib/segment.php b/rest/edi/lib/segment.php index bcd7403a..0ee17d73 100644 --- a/rest/edi/lib/segment.php +++ b/rest/edi/lib/segment.php @@ -35,4 +35,3 @@ class Segment } } -?> diff --git a/rest/edi/load.php b/rest/edi/load.php index deed9a8b..55516377 100644 --- a/rest/edi/load.php +++ b/rest/edi/load.php @@ -218,4 +218,3 @@ class Load extends Edi\Method } } -?> diff --git a/rest/edi/update.php b/rest/edi/update.php index 87182487..1fb75f41 100644 --- a/rest/edi/update.php +++ b/rest/edi/update.php @@ -122,4 +122,4 @@ class Update extends Vn\Lib\Method } } -?> + diff --git a/rest/image/image.php b/rest/image/image.php index 4296733d..56095a6b 100755 --- a/rest/image/image.php +++ b/rest/image/image.php @@ -144,4 +144,3 @@ class Image } } -?> diff --git a/rest/image/resize.php b/rest/image/resize.php index 6571507b..71ca0df0 100644 --- a/rest/image/resize.php +++ b/rest/image/resize.php @@ -68,4 +68,3 @@ class Resize extends Vn\Lib\Method } } -?> diff --git a/rest/image/sync.php b/rest/image/sync.php index b2bea2c4..04f62831 100644 --- a/rest/image/sync.php +++ b/rest/image/sync.php @@ -127,4 +127,3 @@ class Sync extends Vn\Lib\Method } } -?> diff --git a/rest/image/thumb.php b/rest/image/thumb.php index d747b08d..9784e249 100644 --- a/rest/image/thumb.php +++ b/rest/image/thumb.php @@ -95,4 +95,3 @@ class Thumb extends Vn\Web\RestRequest } } -?> diff --git a/rest/image/upload.php b/rest/image/upload.php index 8cac683e..d07065b3 100755 --- a/rest/image/upload.php +++ b/rest/image/upload.php @@ -145,4 +145,3 @@ class Upload extends Vn\Web\JsonRequest } } -?> diff --git a/rest/image/util.php b/rest/image/util.php index 9525795b..3236bdd4 100755 --- a/rest/image/util.php +++ b/rest/image/util.php @@ -55,5 +55,4 @@ class Util return $info; } } - -?> + diff --git a/rest/misc/contact.php b/rest/misc/contact.php index e1974952..87109b3b 100755 --- a/rest/misc/contact.php +++ b/rest/misc/contact.php @@ -68,4 +68,3 @@ class Contact extends Vn\Web\JsonRequest } } -?> diff --git a/rest/misc/exchange-rate.php b/rest/misc/exchange-rate.php index 59a1d7a6..6cbb6912 100755 --- a/rest/misc/exchange-rate.php +++ b/rest/misc/exchange-rate.php @@ -49,4 +49,3 @@ class ExchangeRate extends Vn\Lib\Method } } -?> diff --git a/rest/misc/mail.php b/rest/misc/mail.php index c0f1f269..472b34ec 100755 --- a/rest/misc/mail.php +++ b/rest/misc/mail.php @@ -92,4 +92,4 @@ class Mail extends Vn\Lib\Method } } -?> + diff --git a/rest/misc/sms.php b/rest/misc/sms.php index f3203116..622e5f3e 100644 --- a/rest/misc/sms.php +++ b/rest/misc/sms.php @@ -49,4 +49,4 @@ class Sms extends Vn\Web\JsonRequest } } -?> + diff --git a/rest/misc/visits-sync.php b/rest/misc/visits-sync.php index 65bdf390..bf6951e6 100644 --- a/rest/misc/visits-sync.php +++ b/rest/misc/visits-sync.php @@ -51,4 +51,3 @@ class VisitsSync extends Vn\Lib\Method } } -?> diff --git a/rest/tpv/confirm-mail.php b/rest/tpv/confirm-mail.php index f62078b9..29cb215e 100644 --- a/rest/tpv/confirm-mail.php +++ b/rest/tpv/confirm-mail.php @@ -104,4 +104,3 @@ class ConfirmMail extends Vn\Lib\Method } } -?> diff --git a/rest/tpv/confirm-post.php b/rest/tpv/confirm-post.php index c9ed97ef..73975773 100644 --- a/rest/tpv/confirm-post.php +++ b/rest/tpv/confirm-post.php @@ -13,4 +13,3 @@ class ConfirmPost extends Vn\Web\RestRequest } } -?> diff --git a/rest/tpv/confirm-soap.php b/rest/tpv/confirm-soap.php index 16f5bf14..86a3b9c6 100644 --- a/rest/tpv/confirm-soap.php +++ b/rest/tpv/confirm-soap.php @@ -94,4 +94,3 @@ function procesaNotificacionSIS ($XML) return $xmlMessage; */} -?> diff --git a/rest/tpv/tpv.php b/rest/tpv/tpv.php index cd79e732..29c439c9 100755 --- a/rest/tpv/tpv.php +++ b/rest/tpv/tpv.php @@ -33,4 +33,3 @@ class Tpv } } -?> diff --git a/rest/tpv/transaction.php b/rest/tpv/transaction.php index 30633465..e71f4bb5 100755 --- a/rest/tpv/transaction.php +++ b/rest/tpv/transaction.php @@ -54,4 +54,3 @@ class Transaction extends Vn\Web\JsonRequest } } -?> diff --git a/web/app.php b/web/app.php index f8d42966..264f818b 100644 --- a/web/app.php +++ b/web/app.php @@ -73,4 +73,3 @@ class App extends \Vn\Lib\App } } -?> diff --git a/web/db-session-handler.php b/web/db-session-handler.php index 0166dcf3..aa51a01b 100755 --- a/web/db-session-handler.php +++ b/web/db-session-handler.php @@ -53,4 +53,3 @@ class DbSessionHandler implements \SessionHandlerInterface } } -?> diff --git a/web/html-service.php b/web/html-service.php index e88a9ac6..401f97e4 100644 --- a/web/html-service.php +++ b/web/html-service.php @@ -14,7 +14,7 @@ class HtmlService extends Service $db = $this->db; if (!$this->isHttps () - && $db->getValue ('SELECT https FROM config') && !_DEBUG_MODE) + && $db->getValue ('SELECT https FROM config') && !_DEV_MODE) { header ("Location: https://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"); exit (0); @@ -139,4 +139,3 @@ class HtmlService extends Service } } -?> diff --git a/web/json-exception.php b/web/json-exception.php index 783d071f..e81bb677 100755 --- a/web/json-exception.php +++ b/web/json-exception.php @@ -19,4 +19,3 @@ class JsonException var $trace = NULL; } -?> diff --git a/web/json-reply.php b/web/json-reply.php index 2ef0c85a..deacf41a 100755 --- a/web/json-reply.php +++ b/web/json-reply.php @@ -14,4 +14,3 @@ class JsonReply var $warnings = NULL; } -?> diff --git a/web/json-request.php b/web/json-request.php index ddbe9554..58c5bdf5 100644 --- a/web/json-request.php +++ b/web/json-request.php @@ -7,4 +7,3 @@ namespace Vn\Web; **/ abstract class JsonRequest extends RestRequest {} -?> diff --git a/web/json-service.php b/web/json-service.php index 0653c710..3c849699 100644 --- a/web/json-service.php +++ b/web/json-service.php @@ -58,12 +58,12 @@ class JsonService extends RestService $json = new JsonException (); - if (_DEBUG_MODE || $errno & $eUser) + if (_DEV_MODE || $errno & $eUser) $json->message = $message; else $json->message = 'Something went wrong'; - if (_DEBUG_MODE) + if (_DEV_MODE) { $json->code = $errno; $json->file = $file; @@ -91,7 +91,7 @@ class JsonService extends RestService { $json = new JsonException (); - if (_DEBUG_MODE || $e instanceof Lib\UserException) + if (_DEV_MODE || $e instanceof Lib\UserException) { $json->exception = get_class ($e); $json->message = $e->getMessage (); @@ -102,7 +102,7 @@ class JsonService extends RestService $json->message = 'Something went wrong'; } - if (_DEBUG_MODE) + if (_DEV_MODE) { $json->code = $e->getCode (); $json->file = $e->getFile (); @@ -118,4 +118,3 @@ class JsonService extends RestService } } -?> diff --git a/web/jwt.php b/web/jwt.php index 2e3e94fc..9b4805fe 100755 --- a/web/jwt.php +++ b/web/jwt.php @@ -87,4 +87,3 @@ class Jwt } } -?> diff --git a/web/rest-request.php b/web/rest-request.php index 39b4b07e..01cd11d6 100644 --- a/web/rest-request.php +++ b/web/rest-request.php @@ -19,4 +19,3 @@ abstract class RestRequest extends \Vn\Lib\Method var $service; } -?> diff --git a/web/rest-service.php b/web/rest-service.php index b825e0f4..b0624e33 100644 --- a/web/rest-service.php +++ b/web/rest-service.php @@ -11,7 +11,7 @@ class RestService extends Service { function run () { - ini_set ('display_errors', _DEBUG_MODE); + ini_set ('display_errors', _DEV_MODE); set_error_handler ([$this, 'errorHandler'], E_ALL); set_exception_handler ([$this, 'exceptionHandler']); @@ -59,4 +59,3 @@ class RestService extends Service } } -?> diff --git a/web/service.php b/web/service.php index e37c8b1c..521b8334 100755 --- a/web/service.php +++ b/web/service.php @@ -310,4 +310,3 @@ abstract class Service } } -?> diff --git a/web/util.php b/web/util.php index a533e83b..b5ae3918 100644 --- a/web/util.php +++ b/web/util.php @@ -42,4 +42,3 @@ class Util } } -?> diff --git a/webpack.config.js b/webpack.config.js index 1edc7fae..e9c2c585 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,7 +1,6 @@ var webpack = require ('webpack'); var path = require ('path'); -var SplitPlugin = require ('./split-plugin'); var devMode = true; @@ -29,10 +28,8 @@ module.exports = fallback: process.env.NODE_PATH }, plugins: [ - new SplitPlugin (), -/* new webpack.IgnorePlugin (new RegExp ('/.{2}/(forms|pages|rest)')) - new webpack.optimize.UglifyJsPlugin ({minimize: true}) -*/ ], - devtool: 'source-map' +// new webpack.optimize.UglifyJsPlugin ({minimize: true}) + ], +// devtool: 'source-map' };