diff --git a/debian/changelog b/debian/changelog
index d40e6cb9..290db9a7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-hedera-web (1.353-deb8) stable; urgency=low
+hedera-web (1.354-deb8) stable; urgency=low
* Initial Release.
diff --git a/debian/cron.d b/debian/cron.d
index d26b7a7c..d4b0bc1b 100644
--- a/debian/cron.d
+++ b/debian/cron.d
@@ -1,8 +1,8 @@
MAILTO=webmaster
-*/4 * * * * root php /usr/share/hedera-web/cli.php -m tpv/confirm-mail
-*/2 * * * * root php /usr/share/hedera-web/cli.php -m edi/load
-0 23 * * * root php /usr/share/hedera-web/cli.php -m edi/clean
-0 5 * * * root php /usr/share/hedera-web/cli.php -m edi/update
-*/1 * * * * root php /usr/share/hedera-web/cli.php -m misc/mail
-0 5 * * * root php /usr/share/hedera-web/cli.php -m misc/exchange-rate
-45 14 20 11 * root php /usr/share/hedera-web/cli.php -m misc/exchange-rate
+*/4 * * * * root /usr/share/hedera-web/cli.php -m tpv/confirm-mail
+*/2 * * * * root /usr/share/hedera-web/cli.php -m edi/load
+0 23 * * * root /usr/share/hedera-web/cli.php -m edi/clean
+0 5 * * * root /usr/share/hedera-web/cli.php -m edi/update
+*/1 * * * * root /usr/share/hedera-web/cli.php -m misc/mail
+0 5 * * * root /usr/share/hedera-web/cli.php -m misc/exchange-rate
+45 14 20 11 * root /usr/share/hedera-web/cli.php -m misc/exchange-rate
diff --git a/debian/postinst b/debian/postinst
index 664c7c3e..23f7c1b8 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -1,8 +1,7 @@
#!/bin/bash
+cd /usr/share/hedera-web && npm install --production
a2enconf hedera-web
service apache2 reload
service cron restart
-cd /usr/share/hedera-web && npm install --production
-
diff --git a/debian/postrm b/debian/postrm
index 1cf85653..d2d54aca 100755
--- a/debian/postrm
+++ b/debian/postrm
@@ -1,5 +1,5 @@
#!/bin/bash
+rm -rf /usr/share/hedera-web/node_modules
service apache2 reload
service cron restart
-
diff --git a/forms/account/conf/ui.xml b/forms/account/conf/ui.xml
index fc130b14..6885f3ae 100755
--- a/forms/account/conf/ui.xml
+++ b/forms/account/conf/ui.xml
@@ -47,7 +47,7 @@
diff --git a/forms/admin/access-log/ui.xml b/forms/admin/access-log/ui.xml
index a3eaa665..25c7fc28 100755
--- a/forms/admin/access-log/ui.xml
+++ b/forms/admin/access-log/ui.xml
@@ -41,13 +41,13 @@
- SELECT u.date_time, a.platform, a.browser, a.version, a.javascript, a.cookies
- FROM visit_user u
- JOIN visit_access c ON u.access_id = c.id
- JOIN visit_agent a ON c.agent_id = a.id
- WHERE u.user_id = #user
- ORDER BY u.date_time DESC
- LIMIT 8
+ SELECT u.stamp, a.platform, a.browser, a.version, a.javascript, a.cookies
+ FROM visitUser u
+ JOIN visitAccess c ON c.id = u.access
+ JOIN visitAgent a ON a.id = c.agent
+ WHERE u.user = #user
+ ORDER BY u.stamp DESC
+ LIMIT 8
@@ -58,18 +58,14 @@
+
diff --git a/forms/admin/connections/connections.js b/forms/admin/connections/connections.js
index a7d4efc6..bb5c2993 100644
--- a/forms/admin/connections/connections.js
+++ b/forms/admin/connections/connections.js
@@ -30,7 +30,7 @@ Hedera.Connections = new Class
{
this.hash.set ({
'form': 'admin/access-log'
- ,'user': form.get ('user_id')
+ ,'user': form.get ('userId')
});
}
diff --git a/forms/admin/connections/ui.xml b/forms/admin/connections/ui.xml
index ac673f32..f47a4c6d 100755
--- a/forms/admin/connections/ui.xml
+++ b/forms/admin/connections/ui.xml
@@ -22,16 +22,16 @@
- SELECT s.id, e.user_id, c.Cliente, e.date_time login, is_new,
- s.lastUpdate last_activity, a.platform, a.browser, a.version, u.name user
+ SELECT s.id, vu.user userId, vu.stamp, c.Cliente, s.lastUpdate,
+ a.platform, a.browser, a.version, u.name user
FROM userSession s
- JOIN visit_user e ON s.userVisit = e.id
- JOIN visit_access c ON e.access_id = c.id
- JOIN visit_agent a ON c.agent_id = a.id
- JOIN visit v ON a.visit_id = v.id
- JOIN account.user u ON e.user_id = u.id
- JOIN vn2008.Clientes c ON e.user_id = c.Id_cliente
- ORDER BY last_activity DESC
+ JOIN visitUser vu ON vu.id = s.userVisit
+ JOIN visitAccess ac ON ac.id = vu.access
+ JOIN visitAgent a ON a.id = ac.agent
+ JOIN visit v ON v.id = a.visit
+ JOIN account.user u ON u.id = vu.user
+ JOIN vn2008.Clientes c ON c.Id_cliente = vu.user
+ ORDER BY lastUpdate DESC
@@ -52,15 +52,15 @@
- -
-
+ -
+
-
-
+
diff --git a/forms/admin/visits/ui.xml b/forms/admin/visits/ui.xml
index 44e14977..291b6677 100755
--- a/forms/admin/visits/ui.xml
+++ b/forms/admin/visits/ui.xml
@@ -42,7 +42,7 @@
+ column-name="newVisits"/>
news
@@ -52,16 +52,16 @@
SELECT browser
- ,MIN(CAST(version AS DECIMAL(4,1))) min_version
- ,MAX(CAST(version AS DECIMAL(4,1))) max_version
- ,MAX(e.date_time) last_visit
+ ,MIN(CAST(version AS DECIMAL(4,1))) minVersion
+ ,MAX(CAST(version AS DECIMAL(4,1))) maxVersion
+ ,MAX(c.stamp) lastVisit
,COUNT(DISTINCT c.id) visits
- ,SUM(is_new) new_visits
- FROM visit_user e
- JOIN visit_access c ON e.access_id = c.id
- JOIN visit_agent a ON c.agent_id = a.id
- JOIN visit v ON a.visit_id = v.id
- WHERE e.date_time BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59')
+ ,SUM(a.firstAccess = c.id AND v.firstAgent = a.id) newVisits
+ FROM visitUser e
+ JOIN visitAccess c ON e.access = c.id
+ JOIN visitAgent a ON c.agent = a.id
+ JOIN visit v ON a.visit = v.id
+ WHERE c.stamp BETWEEN TIMESTAMP(#from,'00:00:00') AND TIMESTAMP(#to,'23:59:59')
GROUP BY browser ORDER BY visits DESC
@@ -75,19 +75,19 @@
- -
-
+ -
+
visits,
-
+
news
-
+
-
+
diff --git a/js/hedera/login.js b/js/hedera/login.js
index afc69cc0..0492f1c5 100644
--- a/js/hedera/login.js
+++ b/js/hedera/login.js
@@ -138,6 +138,7 @@ module.exports = new Class
{
localStorage.removeItem ('hederaGuest');
this._focusUserInput ();
+ throw error;
}
}
@@ -175,10 +176,10 @@ module.exports = new Class
,_onPasswordRecovered: function (json, error)
{
- if (json)
- Htk.Toast.showMessage (_('A mail has been sent wich you can recover your password'));
- else
- Htk.Toast.showError (error.message);
+ if (error)
+ throw error;
+
+ Htk.Toast.showMessage (_('A mail has been sent wich you can recover your password'));
}
});
diff --git a/js/hedera/tpv.js b/js/hedera/tpv.js
index 4d484d7e..ec276777 100644
--- a/js/hedera/tpv.js
+++ b/js/hedera/tpv.js
@@ -17,7 +17,7 @@ module.exports = new Class
batch.addValue ('transaction', this.tpvOrder);
batch.addValue ('status', this.tpvStatus);
- var query = 'CALL transaction_end (#transaction, #status)';
+ var query = 'CALL transactionEnd (#transaction, #status)';
this.conn.execQuery (query, null, batch);
}
diff --git a/js/htk/field/calendar.js b/js/htk/field/calendar.js
index 3c1aed53..057c9690 100644
--- a/js/htk/field/calendar.js
+++ b/js/htk/field/calendar.js
@@ -79,32 +79,10 @@ module.exports = new Class
var th = document.createElement ('th');
tr.appendChild (th);
- var weekday = Vn.Date.AbrWDays [i%len];
+ var weekday = _(Vn.Date.AbrWDays [i%len]);
th.appendChild (document.createTextNode (weekday));
}
-/*
- var tfoot = document.createElement ('tfoot');
- table.appendChild (tfoot);
- var tr = document.createElement ('tr');
- tfoot.appendChild (tr);
-
- var th = document.createElement ('th');
- th.appendChild (document.createTextNode ('<'));
- th.className = 'button';
- th.addEventListener ('click', this.prevYearClicked.bind (this));
- tr.appendChild (th);
-
- var yearNode = document.createElement ('th');
- yearNode.colSpan = 5;
- tr.appendChild (yearNode);
-
- var th = document.createElement ('th');
- th.appendChild (document.createTextNode ('>'));
- th.className = 'button';
- th.addEventListener ('click', this.nextYearClicked.bind (this));
- tr.appendChild (th);
-*/
var tbody = document.createElement ('tbody');
table.appendChild (tbody);
@@ -175,7 +153,7 @@ module.exports = new Class
,refresh: function ()
{
Vn.Node.setText (this.yearNode, this.year);
- Vn.Node.setText (this.monthNode, Vn.Date.Months[this.month]);
+ Vn.Node.setText (this.monthNode, _(Vn.Date.Months[this.month]));
var day = 1;
var cellDate = new Date (this.year, this.month, 1);
@@ -292,16 +270,4 @@ module.exports = new Class
this.refresh ();
}
-/*
- ,prevYearClicked: function ()
- {
- this.year--;
- this.refresh ();
- }
-
- ,nextYearClicked: function ()
- {
- this.year++;
- this.refresh ();
- }*/
});
diff --git a/js/htk/style.css b/js/htk/style.css
index b2c06930..81d4ffd8 100644
--- a/js/htk/style.css
+++ b/js/htk/style.css
@@ -382,7 +382,7 @@ td.cell-image .htk-image
left: 50%;
top: 4em;
width: 21em;
- margin-left: -10.5em;
+ margin-left: -11em;
text-align: center;
overflow: auto;
max-height: 40em;
diff --git a/js/vn/date.js b/js/vn/date.js
index a1238b81..78691d87 100644
--- a/js/vn/date.js
+++ b/js/vn/date.js
@@ -11,56 +11,56 @@ module.exports =
{
WDays:
[
- _('Sunday')
- ,_('Monday')
- ,_('Tuesday')
- ,_('Wednesday')
- ,_('Thursday')
- ,_('Friday')
- ,_('Saturday')
+ 'Sunday'
+ ,'Monday'
+ ,'Tuesday'
+ ,'Wednesday'
+ ,'Thursday'
+ ,'Friday'
+ ,'Saturday'
]
,AbrWDays:
[
- _('Su')
- ,_('Mo')
- ,_('Tu')
- ,_('We')
- ,_('Th')
- ,_('Fr')
- ,_('Sa')
+ 'Su'
+ ,'Mo'
+ ,'Tu'
+ ,'We'
+ ,'Th'
+ ,'Fr'
+ ,'Sa'
]
,Months:
[
- _('January')
- ,_('February')
- ,_('March')
- ,_('April')
- ,_('May')
- ,_('June')
- ,_('July')
- ,_('August')
- ,_('September')
- ,_('October')
- ,_('November')
- ,_('December')
+ 'January'
+ ,'February'
+ ,'March'
+ ,'April'
+ ,'May'
+ ,'June'
+ ,'July'
+ ,'August'
+ ,'September'
+ ,'October'
+ ,'November'
+ ,'December'
]
,AbrMonths:
[
- _('Jan')
- ,_('Feb')
- ,_('Mar')
- ,_('Apr')
- ,_('May')
- ,_('Jun')
- ,_('Jul')
- ,_('Ago')
- ,_('Sep')
- ,_('Oct')
- ,_('Nov')
- ,_('Dec')
+ 'Jan'
+ ,'Feb'
+ ,'Mar'
+ ,'Apr'
+ ,'May'
+ ,'Jun'
+ ,'Jul'
+ ,'Ago'
+ ,'Sep'
+ ,'Oct'
+ ,'Nov'
+ ,'Dec'
]
- ,tokenD: _('%A, %B %e')
+ ,tokenD: '%A, %B %e'
,regexp: new RegExp ('%[a-zA-Z]', 'g')
@@ -86,10 +86,10 @@ module.exports =
case 'T': return d.toLocaleTimeString ();
// Complete week day name
- case 'A': return this.WDays[d.getDay ()];
+ case 'A': return _(this.WDays[d.getDay ()]);
// Abreviated week day name
- case 'a': return this.AbrWDays[d.getDay ()];
+ case 'a': return _(this.AbrWDays[d.getDay ()]);
// Day of month with 2 digits
case 'd': return this.pad (d.getDate ());
@@ -98,10 +98,10 @@ module.exports =
case 'e': return d.getDate ();
// Complete month name
- case 'B': return this.Months[d.getMonth ()];
+ case 'B': return _(this.Months[d.getMonth ()]);
// Abreviated month name
- case 'b': return this.AbrMonths[d.getMonth ()];
+ case 'b': return _(this.AbrMonths[d.getMonth ()]);
// Month number with 2 digits
case 'm': return this.pad (d.getMonth () + 1);
@@ -110,7 +110,7 @@ module.exports =
case 'Y': return d.getFullYear ();
// Complete date without year
- case 'D': return this.tokenD.replace (this.regexp, this.regexpFunc.bind (this, d));
+ case 'D': return _(this.tokenD).replace (this.regexp, this.regexpFunc.bind (this, d));
}
return token;
diff --git a/js/vn/locale.js b/js/vn/locale.js
index 907e1ea8..7fe06645 100644
--- a/js/vn/locale.js
+++ b/js/vn/locale.js
@@ -1,14 +1,12 @@
-var vnLocaleStrings = {};
+vnLocaleStrings = {};
/**
* Class to manage the internationalization.
**/
module.exports =
{
- strings: {}
-
- ,language: null
+ language: null
,init: function ()
{
diff --git a/locale/ca/forms/account/conf.json b/locale/ca/forms/account/conf.json
index 0dfa287d..86df23d6 100755
--- a/locale/ca/forms/account/conf.json
+++ b/locale/ca/forms/account/conf.json
@@ -1,19 +1,30 @@
{
- "Configuration": "Configuració"
+ "Configuration": "Configuració"
- ,"UserNumber": "N d'usuari"
- ,"UserName": "Nom d'usuari"
+ ,"Username": "Nom d'usuari"
,"Password": "Contrasenya"
,"Email": "Correu electrònic"
,"Billing": "Facturació"
- ,"ReceiveInvoicesByEmail": "Rebre factures per correu electrònic"
+ ,"Receive invoices by email": "Rebre factures per correu electrònic"
- ,"NewPassword": "Nova contrasenya"
- ,"RepeatPassword": "Repetir contrasenya"
+ ,"Old password": "Contrasenya antiga"
+ ,"New password": "Nova contrasenya"
+ ,"Repeat password": "Repetir contrasenya"
+ ,"Info": "Info"
+ ,"Modify": "Modificar"
- ,"MustReloginIfChange": "Per canviar el nom d'usuari hauràs de tornar a iniciar sessió"
- ,"PasswordsChanged": "Contrasenya modificada!"
- ,"PasswordsDoesntMatch": "Les contrasenyes no coincideixen!"
+ ,"Password requirements": "Requisits de contrasenya"
+ ,"characters long": "caràcters de longitud"
+ ,"alphabetic characters": "caràcters alfabètics"
+ ,"capital letters": "majúscules"
+ ,"digits": "dígits"
+ ,"symbols": "símbols"
+
+ ,"Password changed!": "Contrasenya modificada!"
+ ,"Password doesn't meet the requirements": ""
+ ,"Passwords doesn't match": "Les contrasenyes no coincideixen!"
+ ,"Passwords empty": "Les contrasenyes en blanc"
,"Addresses": "Adreces"
+ ,"Change password": "Canvia la contrasenya"
}
diff --git a/locale/ca/js/hedera.json b/locale/ca/js/hedera.json
index 63e317c7..35889e05 100644
--- a/locale/ca/js/hedera.json
+++ b/locale/ca/js/hedera.json
@@ -7,10 +7,15 @@
,"Enter": "Entrar"
,"Login mail": "clientes@verdnatura.es"
,"Login phone": "+34 607 562 391"
+ ,"Password forgotten? Push here": "¿Has oblidat la teva contrasenya?"
+ ,"Yet you are not a customer?": "Encara no ets client?"
+ ,"Sign up": "Registrarme"
,"You've been too idle": "Has estat massa temps inactiu i la sessió ha expirat"
,"Invalid login": "Usuari o contrasenya incorrectes, recorda que s'hi distingeix entre majúscula i minúscula"
- ,"There was an internal error": "S'ha produït un error intern"
+ ,"There was an internal error": "S'ha produït un error intern"
+ ,"Please write your user name": "Si us plau introdueix el teu nom d'usuari"
+ ,"A mail has been sent wich you can recover your password": "T'hem enviat un correu on podràs recuperar la teva contrasenya"
,"Menu": "Menú"
,"Exit": "Sortir"
diff --git a/locale/en/forms/account/conf.json b/locale/en/forms/account/conf.json
index af7261c4..9fa1867c 100755
--- a/locale/en/forms/account/conf.json
+++ b/locale/en/forms/account/conf.json
@@ -1,19 +1,30 @@
{
"Configuration": "Configuration"
- ,"UserNumber": "User number"
- ,"UserName": "Username"
+ ,"Username": "Username"
,"Password": "Password"
,"Email": "Email"
,"Billing": "Billing"
- ,"ReceiveInvoicesByEmail": "Receive invoices by email"
+ ,"Receive invoices by email": "Receive invoices by email"
- ,"NewPassword": "New password"
- ,"RepeatPassword": "Repeat password"
+ ,"Old password": "Old password"
+ ,"New password": "New password"
+ ,"Repeat password": "Repeat password"
+ ,"Info": "Info"
+ ,"Modify": "Modify"
+
+ ,"Password requirements": "Password requirements"
+ ,"characters long": "characters long"
+ ,"alphabetic characters": "alphabetic characters"
+ ,"capital letters": "capital letters"
+ ,"digits": "digits"
+ ,"symbols": "symbols. Ej: $%&."
- ,"MustReloginIfChange": "To change your username you must login again"
- ,"PasswordsChanged": "Password changed!"
- ,"PasswordsDoesntMatch": "Passwords do not match!"
+ ,"Password changed!": "Password changed!"
+ ,"Password doesn't meet the requirements": "Password doesn't meet the requirements, press info button for more details"
+ ,"Passwords doesn't match": "Passwords doesn't match"
+ ,"Passwords empty": "Passwords empty"
,"Addresses": "Addresses"
+ ,"Change password": "Change password"
}
diff --git a/locale/en/js/hedera.json b/locale/en/js/hedera.json
index e65647ed..79df4760 100644
--- a/locale/en/js/hedera.json
+++ b/locale/en/js/hedera.json
@@ -7,10 +7,15 @@
,"Enter": "Enter"
,"Login mail": "clientes@verdnatura.es"
,"Login phone": "+34 607 562 391"
+ ,"Password forgotten? Push here": "Password forgotten? Push here"
+ ,"Yet you are not a customer?": "Yet you are not a customer?"
+ ,"Sign up": "Sign up"
,"You've been too idle": "You have been idle too long and your session has expired"
,"Invalid login": "Username or password incorrect, remember that it is case-sensitive"
,"There was an internal error": "There was an internal error"
+ ,"Please write your user name": "Please write your user name"
+ ,"A mail has been sent wich you can recover your password": "A mail has been sent wich you can recover your password"
,"Menu": "Menu"
,"Exit": "Exit"
diff --git a/locale/en/reports/recover-password.json b/locale/en/reports/recover-password.json
new file mode 100644
index 00000000..fe974be8
--- /dev/null
+++ b/locale/en/reports/recover-password.json
@@ -0,0 +1,5 @@
+{
+ "Recover password": "Recover password"
+ ,"Press on the following link to change your password.":
+ "Press on the following link to change your password."
+}
diff --git a/locale/en/rest/image/upload.json b/locale/en/rest/image/upload.json
new file mode 100755
index 00000000..1fa3c051
--- /dev/null
+++ b/locale/en/rest/image/upload.json
@@ -0,0 +1,28 @@
+{
+ "Cant lock cache": "The cache could not be blocked"
+ ,"Bad file format": "Unrecognized file format"
+ ,"File not choosed": "You have not selected any file"
+ ,"Permission denied": "You are not allowed to upload the file"
+ ,"File upload error": "Failed to upload the file, check that size is not too large"
+ ,"File save error": "Failed to save the file: %s"
+ ,"File size error": "The file must be no longer than %.2f MB"
+ ,"Bad file name": "The file name must contain only lowercase letters, digits or the '_' character"
+ ,"Bad schema name": "Invalid schema name"
+ ,"Schema not exists": "Schema does not exist"
+ ,"Unreferenced file": "The file is not referenced by the database"
+ ,"Com error": "Error communicating with the server"
+ ,"Image open error": "Error opening the image file"
+ ,"Operation disabled": "Operation disabled for security"
+ ,"Image added": "Image added correctly"
+
+ ,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
+ ,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
+ ,"ErrPartial": "File was partially uploaded"
+ ,"ErrNoFile": "No file was uploaded"
+ ,"ErrNoTmpDir": "Missing a temporary folder"
+ ,"ErrCantWrite": "Failed to write file to disk"
+ ,"ErrExtension": "File upload stopped by extension"
+ ,"ErrDefault": "Unknown upload error"
+
+ ,"Sync complete": "Synchronization complete"
+}
diff --git a/locale/en/rest/query.json b/locale/en/rest/query.json
deleted file mode 100755
index 75f9e384..00000000
--- a/locale/en/rest/query.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "InvalidAction": "Invalid action"
-
- ,"EmptyQuery": "Empty query"
-}
diff --git a/locale/en/vn/image.json b/locale/en/vn/image.json
deleted file mode 100755
index 9e436ec1..00000000
--- a/locale/en/vn/image.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "CantLockCache": "The cache could not be blocked"
- ,"BadFileFormat": "Unrecognized file format"
- ,"FileNotChoosed": "You have not selected any file"
- ,"PermissionDenied": "You are not allowed to upload the file"
- ,"FileUploadError": "Failed to upload the file, check that size is not too large"
- ,"FileSaveError": "Failed to save the file: %s"
- ,"FileSizeError": "The file must be no longer than %.2f MB"
- ,"BadFileName": "The file name must contain only lowercase letters, digits or the '_' character"
- ,"BadSchemaName": "Invalid schema name"
- ,"SchemaNotExists": "Schema does not exist"
- ,"UnreferencedFile": "The file is not referenced by the database"
- ,"ComError": "Error communicating with the server"
- ,"ImageOpenError": "Error opening the image file"
- ,"OperationDisabled": "Operation disabled for security"
- ,"ImageAdded": "Image added correctly"
-
- ,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
- ,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
- ,"ErrPartial": "File was partially uploaded"
- ,"ErrNoFile": "No file was uploaded"
- ,"ErrNoTmpDir": "Missing a temporary folder"
- ,"ErrCantWrite": "Failed to write file to disk"
- ,"ErrExtension": "File upload stopped by extension"
- ,"ErrDefault": "Unknown upload error"
-
- ,"SyncComplete": "Synchronization complete"
-}
diff --git a/locale/en/vn/web.json b/locale/en/vn/web.json
new file mode 100755
index 00000000..bfee1158
--- /dev/null
+++ b/locale/en/vn/web.json
@@ -0,0 +1,4 @@
+{
+ "You don't have enough privileges": "You don't have enough privileges"
+ ,"Missing parameters": "Missing parameters"
+}
diff --git a/locale/es/forms/account/conf.json b/locale/es/forms/account/conf.json
index 073ccd6e..4a2a95ac 100755
--- a/locale/es/forms/account/conf.json
+++ b/locale/es/forms/account/conf.json
@@ -1,19 +1,30 @@
{
"Configuration": "Configuración"
- ,"UserNumber": "Nº usuario"
- ,"UserName": "Nombre de usuario"
+ ,"Username": "Nombre de usuario"
,"Password": "Contraseña"
,"Email": "Correo electrónico"
,"Billing": "Facturación"
- ,"ReceiveInvoicesByEmail": "Recibir facturas por correo electrónico"
+ ,"Receive invoices by email": "Recibir facturas por correo electrónico"
- ,"NewPassword": "Nueva contraseña"
- ,"RepeatPassword": "Repetir contraseña"
+ ,"Old password": "Contaseña antigua"
+ ,"New password": "Nueva contraseña"
+ ,"Repeat password": "Repetir contraseña"
+ ,"Info": "Info"
+ ,"Modify": "Modificar"
+
+ ,"Password requirements": "Requisitos de constraseña"
+ ,"characters long": "carácteres de longitud"
+ ,"alphabetic characters": "carácteres alfabéticos"
+ ,"capital letters": "letras mayúsculas"
+ ,"digits": "dígitos"
+ ,"symbols": "símbolos. Ej: $%&."
- ,"MustReloginIfChange": "Para cambiar tu nombre de usuario deberás volver a iniciar sesión"
- ,"PasswordsChanged": "¡Contraseña modificada!"
- ,"PasswordsDoesntMatch": "¡Las contraseñas no coinciden!"
+ ,"Password changed!": "¡Contraseña modificada!"
+ ,"Password doesn't meet the requirements": "La nueva contraseña no reune los requisitos de seguridad necesarios, pulsa en info para más detalle"
+ ,"Passwords doesn't match": "¡Las contraseñas no coinciden!"
+ ,"Passwords empty": "Contraseña vacía"
,"Addresses": "Direcciones"
+ ,"Change password": "Cambiar contraseña"
}
diff --git a/locale/es/js/hedera.json b/locale/es/js/hedera.json
index d94307bb..4c81f8af 100644
--- a/locale/es/js/hedera.json
+++ b/locale/es/js/hedera.json
@@ -7,10 +7,15 @@
,"Enter": "Entrar"
,"Login mail": "clientes@verdnatura.es"
,"Login phone": "+34 963 242 100"
+ ,"Password forgotten? Push here": "¿Has olvidado tu contraseña?"
+ ,"Yet you are not a customer?": "¿Todavía no eres cliente?"
+ ,"Sign up": "Registrarme"
,"You've been too idle": "Has estado demasiado tiempo inactivo y la sesión ha expirado"
,"Invalid login": "Usuario o contraseña incorrectos, recuerda que se hace distinción entre mayúsculas y minúsculas"
,"There was an internal error": "Se ha producido un error interno"
+ ,"Please write your user name": "Por favor escribe tu nombre de usuario"
+ ,"A mail has been sent wich you can recover your password": "Te hemos enviado un correo donde podrás recuperar tu contraseña"
,"Menu": "Menú"
,"Exit": "Salir"
diff --git a/locale/es/reports/recover-password.json b/locale/es/reports/recover-password.json
new file mode 100644
index 00000000..eda30383
--- /dev/null
+++ b/locale/es/reports/recover-password.json
@@ -0,0 +1,5 @@
+{
+ "Recover password": "Restaurar contraseña"
+ ,"Press on the following link to change your password.":
+ "Presiona en el siguiente link para cambiar tu contraseña."
+}
diff --git a/locale/es/rest/image/upload.json b/locale/es/rest/image/upload.json
new file mode 100755
index 00000000..3d51f42e
--- /dev/null
+++ b/locale/es/rest/image/upload.json
@@ -0,0 +1,28 @@
+{
+ "Cant lock cache": "La caché no pudo ser bloqueada"
+ ,"Bad file format": "Formato de archivo no reconocido"
+ ,"File not choosed": "No has seleccionado ningún archivo"
+ ,"Permission denied": "No tienes permiso para subir el fichero"
+ ,"File upload error": "Error al subir el fichero, comprueba que su tamaño no sea demasiado grande"
+ ,"File save error": "Error al guardar el fichero: %s"
+ ,"File size error": "El fichero no debe ocupar más de %.2f MB"
+ ,"Bad file name": "El nombre del archivo solo debe contener letras minúsculas, dígitos o el carácter '_'"
+ ,"Bad schema name": "Nombre de esquema no válido"
+ ,"Schema not exists": "El esquema no existe"
+ ,"Unreferenced file": "El archivo no está referenciado por la base de datos"
+ ,"Com error": "Error en la comunicación con el servidor"
+ ,"Image open error": "Error al abrir el archivo de imagen"
+ ,"Operation disabled": "Operación deshabilitada por seguridad"
+ ,"Image added": "Imagen añadida correctamente"
+
+ ,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
+ ,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
+ ,"ErrPartial": "File was partially uploaded"
+ ,"ErrNoFile": "No file was uploaded"
+ ,"ErrNoTmpDir": "Missing a temporary folder"
+ ,"ErrCantWrite": "Failed to write file to disk"
+ ,"ErrExtension": "File upload stopped by extension"
+ ,"ErrDefault": "Unknown upload error"
+
+ ,"Sync complete": "Sincronización completada"
+}
diff --git a/locale/es/rest/query.json b/locale/es/rest/query.json
deleted file mode 100755
index dae2d046..00000000
--- a/locale/es/rest/query.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "InvalidAction": "Acción inválida"
-
- ,"EmptyQuery": "Consulta vacía"
-}
diff --git a/locale/es/vn/image.json b/locale/es/vn/image.json
deleted file mode 100755
index b5dac435..00000000
--- a/locale/es/vn/image.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "CantLockCache": "La caché no pudo ser bloqueada"
- ,"BadFileFormat": "Formato de archivo no reconocido"
- ,"FileNotChoosed": "No has seleccionado ningún archivo"
- ,"PermissionDenied": "No tienes permiso para subir el fichero"
- ,"FileUploadError": "Error al subir el fichero, comprueba que su tamaño no sea demasiado grande"
- ,"FileSaveError": "Error al guardar el fichero: %s"
- ,"FileSizeError": "El fichero no debe ocupar más de %.2f MB"
- ,"BadFileName": "El nombre del archivo solo debe contener letras minúsculas, dígitos o el carácter '_'"
- ,"BadSchemaName": "Nombre de esquema no válido"
- ,"SchemaNotExists": "El esquema no existe"
- ,"UnreferencedFile": "El archivo no está referenciado por la base de datos"
- ,"ComError": "Error en la comunicación con el servidor"
- ,"ImageOpenError": "Error al abrir el archivo de imagen"
- ,"OperationDisabled": "Operación deshabilitada por seguridad"
- ,"ImageAdded": "Imagen añadida correctamente"
-
- ,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini"
- ,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form"
- ,"ErrPartial": "File was partially uploaded"
- ,"ErrNoFile": "No file was uploaded"
- ,"ErrNoTmpDir": "Missing a temporary folder"
- ,"ErrCantWrite": "Failed to write file to disk"
- ,"ErrExtension": "File upload stopped by extension"
- ,"ErrDefault": "Unknown upload error"
-
- ,"SyncComplete": "Sincronización completada"
-}
diff --git a/locale/es/vn/web.json b/locale/es/vn/web.json
new file mode 100755
index 00000000..ced29b1a
--- /dev/null
+++ b/locale/es/vn/web.json
@@ -0,0 +1,4 @@
+{
+ "You don't have enough privileges": "No tienes suficientes privilegios"
+ ,"Missing parameters": "Faltan parámetros"
+}
diff --git a/locale/fr/forms/account/conf.json b/locale/fr/forms/account/conf.json
index db22049c..009e08d2 100755
--- a/locale/fr/forms/account/conf.json
+++ b/locale/fr/forms/account/conf.json
@@ -1,19 +1,30 @@
{
- "Configuration": "Configuration"
+ "Configuration": "Configuration"
- ,"UserNumber": "Numéro utilisateur"
- ,"UserName": "Utilisateur"
+ ,"Username": "Utilisateur"
,"Password": "Mot de passe"
,"Email": "Courriel"
,"Billing": "Facturation"
- ,"ReceiveInvoicesByEmail": "Recevoir des factures par e-mail"
+ ,"Receive invoices by email": "Recevoir des factures par e-mail"
- ,"NewPassword": "Nouveau mot de passe"
- ,"RepeatPassword": "Répéter le mot de passe"
+ ,"Old password": "Ancien mot de passe"
+ ,"New password": "Nouveau mot de passe"
+ ,"Repeat password": "Répéter le mot de passe"
+ ,"Info": "Info"
+ ,"Modify": "Modifier"
- ,"MustReloginIfChange": "Vous devrez vous identifier à nouveau pour changer votre nom d'utilisateur"
- ,"PasswordsChanged": "Mot de passe modifié!"
- ,"PasswordsDoesntMatch": "Les mots de passe ne correspondent pas!"
+ ,"Password requirements": "Mot de passe exigences"
+ ,"characters long": "Longs caractères"
+ ,"alphabetic characters": "les caractères alphabétiques"
+ ,"capital letters": "lettres majuscules"
+ ,"digits": "chiffres"
+ ,"symbols": "symboles. Ej: $%&."
+
+ ,"Password changed!": "Mot de passe modifié!"
+ ,"Password doesn't meet the requirements": ""
+ ,"Passwords doesn't match": "Les mots de passe ne correspondent pas!"
+ ,"Passwords empty": ""
,"Addresses": "Adresses"
+ ,"Change password": "Changer le mot de passe"
}
diff --git a/locale/fr/js/hedera.json b/locale/fr/js/hedera.json
index f85013c7..2cf30b85 100644
--- a/locale/fr/js/hedera.json
+++ b/locale/fr/js/hedera.json
@@ -7,10 +7,15 @@
,"Enter": "Entrer"
,"Login mail": "ruben@verdnatura.es"
,"Login phone": "+33 781 533 900"
+ ,"Password forgotten? Push here": "as tu oublié ton mot de passe?"
+ ,"Yet you are not a customer?": "Êtes-vous Pas encore client?"
+ ,"Sign up": "Inscription"
,"You've been too idle": "Il a eu le temps de trop paresseux et votre session a expiré"
,"Invalid login": "Utilisateur ou mot de passe incorrect, n'oubliez pas de distinction entre majuscules et minuscules"
,"There was an internal error": "Il ya eu une erreur interne"
+ ,"Please write your user name": "S'il vous plaît entrer votre nom d'utilisateur"
+ ,"A mail has been sent wich you can recover your password": "Nous avons envoyé un e-mail où vous pouvez récupérer votre mot de passe"
,"Menu": "Menu"
,"Exit": "Laisser"
diff --git a/locale/mn/forms/account/conf.json b/locale/mn/forms/account/conf.json
index 3e011fe7..9fa1867c 100755
--- a/locale/mn/forms/account/conf.json
+++ b/locale/mn/forms/account/conf.json
@@ -1,19 +1,30 @@
{
- "Configuration": "ТОХИРГОО"
+ "Configuration": "Configuration"
- ,"UserNumber": "ХЭРЭГЛЭГЧИЙН ТОО:"
- ,"UserName": "НЭВТРЭХ НЭР"
- ,"Password": "НУУЦ ҮГ"
- ,"Email": "И-МЭЙЛ"
- ,"Billing": "НЭХЭМЖЛЭЛ"
- ,"ReceiveInvoicesByEmail": "И-МЭЙЛ НЭХЭМЖЛЭЛ"
+ ,"Username": "Username"
+ ,"Password": "Password"
+ ,"Email": "Email"
+ ,"Billing": "Billing"
+ ,"Receive invoices by email": "Receive invoices by email"
- ,"NewPassword": "ШИНЭ НУУЦ ҮГ"
- ,"RepeatPassword": "НУУЦ ҮГ ДАВТАХ"
+ ,"Old password": "Old password"
+ ,"New password": "New password"
+ ,"Repeat password": "Repeat password"
+ ,"Info": "Info"
+ ,"Modify": "Modify"
+
+ ,"Password requirements": "Password requirements"
+ ,"characters long": "characters long"
+ ,"alphabetic characters": "alphabetic characters"
+ ,"capital letters": "capital letters"
+ ,"digits": "digits"
+ ,"symbols": "symbols. Ej: $%&."
- ,"MustReloginIfChange": "To change your username you must login again"
- ,"PasswordsChanged": "Password changed!"
- ,"PasswordsDoesntMatch": "Passwords do not match!"
+ ,"Password changed!": "Password changed!"
+ ,"Password doesn't meet the requirements": "Password doesn't meet the requirements, press info button for more details"
+ ,"Passwords doesn't match": "Passwords doesn't match"
+ ,"Passwords empty": "Passwords empty"
,"Addresses": "Addresses"
+ ,"Change password": "Change password"
}
diff --git a/locale/mn/js/hedera.json b/locale/mn/js/hedera.json
index 91e71dba..d1d37267 100644
--- a/locale/mn/js/hedera.json
+++ b/locale/mn/js/hedera.json
@@ -7,10 +7,15 @@
,"Enter": "энд бичнэ үү"
,"Login mail": "clientes@verdnatura.es"
,"Login phone": "+34 607 562 391"
+ ,"Password forgotten? Push here": "Нууц үг мартсан? энд түлхэх"
+ ,"Yet you are not a customer?": "Гэсэн хэдий ч та хэрэглэгчийн биш гэж үү?"
+ ,"Sign up": "бүртгүүлэх"
,"You've been too idle": "Та нар ч бас зогссон байсан, чуулган хугацаа дууссан байна"
,"Invalid login": "Хэрэглэгчийн нэр эсвэл нууц үг буруу, Тэр хэргийг мэдрэмтгий гэдгийг санаарай"
,"There was an internal error": "Дотоод алдаа гарлаа"
+ ,"Please write your user name": "Хэрэглэгчийн нэрээ бичнэ үү"
+ ,"A mail has been sent wich you can recover your password": "Мэйл та нууц үгээ сэргээх боломжтой А байна илгээсэн"
,"Menu": "Цэс"
,"Exit": "гарах"
diff --git a/locale/pt/forms/account/conf.json b/locale/pt/forms/account/conf.json
index 73a6ecef..2692b2df 100644
--- a/locale/pt/forms/account/conf.json
+++ b/locale/pt/forms/account/conf.json
@@ -1,19 +1,30 @@
{
"Configuration": "Configuração"
- ,"UserNumber": "Nº usuario"
- ,"UserName": "Nome de usuario"
+ ,"Username": "Nome de usuario"
,"Password": "Palavra-Passe"
,"Email": "E-Mail"
,"Billing": "Facturação"
- ,"ReceiveInvoicesByEmail": "Receber facturas por e-mail"
+ ,"Receive invoices by email": "Receber facturas por e-mail"
- ,"NewPassword": "Nova Palavra-Passe"
- ,"RepeatPassword": "Repetir Palavra-Passe"
+ ,"Old password": "Palavra-Passe antiga"
+ ,"New password": "Nova Palavra-Passe"
+ ,"Repeat password": "Repetir Palavra-Passe"
+ ,"Info": "Info"
+ ,"Modify": "Modificar"
+
+ ,"Password requirements": "Requisitos de Palavra-Passe"
+ ,"characters long": "caracteres"
+ ,"alphabetic characters": "caracteres alfabéticos"
+ ,"capital letters": "letras maiúsculas"
+ ,"digits": "dígitos"
+ ,"symbols": "símbolos. Ej: $%&."
- ,"MustReloginIfChange": "Para modificar seu nome de usario deves voltar a inicar sessão"
- ,"PasswordsChanged": "Palavra-Passe Modificada!"
- ,"PasswordsDoesntMatch": "As Palavras-Passe não coincidem!"
+ ,"Password changed!": "Palavra-Passe Modificada!"
+ ,"Password doesn't meet the requirements": "Palavra-Passe não atende aos requisitos"
+ ,"Passwords doesn't match": "As Palavras-Passe não coincidem!"
+ ,"Passwords empty": "Palavra-Passe vazia"
,"Addresses": "Endereços"
+ ,"Change password": "Mudar Palavra-Passe"
}
diff --git a/locale/pt/js/hedera.json b/locale/pt/js/hedera.json
index 06cbd297..7e8601ae 100644
--- a/locale/pt/js/hedera.json
+++ b/locale/pt/js/hedera.json
@@ -7,10 +7,15 @@
,"Enter": "Entrar"
,"Login mail": "clientes@verdnatura.es"
,"Login phone": "+34 963 242 100"
+ ,"Password forgotten? Push here": "Contra-senha? empurre aqui"
+ ,"Yet you are not a customer?": "No entanto, você não é um cliente?"
+ ,"Sign up": "Inscrever-se"
,"You've been too idle": "Muito tempo de inatividade, a sessão foi finalizada"
,"Invalid login": "Usuário ou Palavra-Passe incorreto, lembre-se de diferenciar maiusculas e minusculas"
,"There was an internal error": "Houve um erro interno"
+ ,"Please write your user name": "Por favor, escreva seu nome de usuário"
+ ,"A mail has been sent wich you can recover your password": "Um e-mail foi enviado a qual poderá recuperar sua senha"
,"Menu": "Menú"
,"Exit": "Sair"
diff --git a/rest/image/upload.php b/rest/image/upload.php
index d07065b3..882cb02c 100755
--- a/rest/image/upload.php
+++ b/rest/image/upload.php
@@ -19,13 +19,13 @@ class Upload extends Vn\Web\JsonRequest
$regexp = '/[^a-z0-9_]/';
if (empty ($_REQUEST['schema']) || preg_match ($regexp, $_REQUEST['schema']) !== 0)
- throw new UserException (s('BadSchemaName'), 'badSchemaName');
+ throw new UserException (s('Bad schema name'));
$schema = $_REQUEST['schema'];
$info = $util->loadInfo ($schema);
if (!$info)
- throw new UserException (s('SchemaNotExists'), 'schemaNotExists');
+ throw new UserException (s('Schema not exists'));
// Checks file name and identifier.
@@ -50,7 +50,7 @@ class Upload extends Vn\Web\JsonRequest
}
if (empty ($_REQUEST['name']) || preg_match ($regexp, $_REQUEST['name']) !== 0)
- throw new UserException (s('BadFileName'), 'badFileName');
+ throw new UserException (s('Bad file name'));
// Checks permissions.
@@ -78,12 +78,12 @@ class Upload extends Vn\Web\JsonRequest
];
if (!$db->query ($query, $params))
- throw new UserException (s('PermissionDenied'), 'permissionDenied');
+ throw new UserException (s('Permission denied'));
// Checks for file errors.
if (empty ($_FILES['image']['name']))
- throw new UserException (s('FileNotChoosed'), 'fileNotChoosed');
+ throw new UserException (s('File not choosed'));
if ($_FILES['image']['error'] != 0)
{
@@ -115,13 +115,13 @@ class Upload extends Vn\Web\JsonRequest
break;
}
- throw new Lib\Exception (s($message), 'uploadError');
+ throw new Lib\Exception (s($message));
}
$maxSize = $db->getValue ('SELECT max_size FROM image_config');
if ($_FILES['image']['size'] > $maxSize * 1048576)
- throw new UserException (sprintf (s('FileSizeError'), $maxSize), 'fileSizeError');
+ throw new UserException (sprintf (s('File size error'), $maxSize));
// Resizes and saves the image.
diff --git a/rest/tpv/transaction.php b/rest/tpv/transaction.php
index e71f4bb5..c024869e 100755
--- a/rest/tpv/transaction.php
+++ b/rest/tpv/transaction.php
@@ -12,23 +12,23 @@ class Transaction extends Vn\Web\JsonRequest
$amount = (int) $_REQUEST['amount'];
$companyId = empty ($_REQUEST['company']) ? NULL : $_REQUEST['company'];
- $row = $db->getRow ('CALL transaction_start_sha256 (#, #)',
+ $row = $db->getRow ('CALL transactionStart (#, #)',
[$amount, $companyId]);
if (!isset ($row))
throw new Exception ('Transaction error');
- $transactionId = str_pad ($row['transaction_id'], 12, '0', STR_PAD_LEFT);
+ $transactionId = str_pad ($row['transactionId'], 12, '0', STR_PAD_LEFT);
$urlOk = empty ($_REQUEST['urlOk']) ? '' : sprintf ($_REQUEST['urlOk'], $transactionId);
$urlKo = empty ($_REQUEST['urlKo']) ? '' : sprintf ($_REQUEST['urlKo'], $transactionId);
- $merchantUrl = $row['merchant_url'] ? $row['merchant_url'] : '';
+ $merchantUrl = $row['merchantUrl'] ? $row['merchantUrl'] : '';
$params = [
'Ds_Merchant_Amount' => $amount
,'Ds_Merchant_Order' => $transactionId
,'Ds_Merchant_MerchantCode' => $row['merchant']
,'Ds_Merchant_Currency' => $row['currency']
- ,'Ds_Merchant_TransactionType' => $row['transaction_type']
+ ,'Ds_Merchant_TransactionType' => $row['transactionType']
,'Ds_Merchant_Terminal' => $row['terminal']
,'Ds_Merchant_MerchantURL' => $merchantUrl
,'Ds_Merchant_UrlOK' => $urlOk
@@ -37,7 +37,7 @@ class Transaction extends Vn\Web\JsonRequest
$encodedParams = base64_encode (json_encode ($params));
- $key = base64_decode ($row['secret_key']);
+ $key = base64_decode ($row['secretKey']);
$bytes = [0, 0, 0, 0, 0, 0, 0, 0];
$iv = implode (array_map ('chr', $bytes));
diff --git a/web/db-session-handler.php b/web/db-session-handler.php
index aa51a01b..fd479bab 100755
--- a/web/db-session-handler.php
+++ b/web/db-session-handler.php
@@ -38,7 +38,6 @@ class DbSessionHandler implements \SessionHandlerInterface
function read ($sessionId)
{
- //$db->query ('DO GET_LOCK(#, 30)', [$sessionId]);
$sessionData = $this->db->getValue (
'SELECT data FROM userSession WHERE ssid = #', [$sessionId]);
return isset ($sessionData) ? $sessionData : '';
@@ -46,9 +45,12 @@ class DbSessionHandler implements \SessionHandlerInterface
function write ($sessionId, $sessionData)
{
- $this->db->query ('REPLACE INTO userSession SET ssid = #, data = #',
+ $this->db->query (
+ 'INSERT INTO userSession SET
+ ssid = #, data = #, lastUpdate = NOW()
+ ON DUPLICATE KEY UPDATE
+ data = VALUES(data), lastUpdate = VALUES(lastUpdate)',
[$sessionId, $sessionData]);
- //$db->query ('DO RELEASE_LOCK(#)', [$sessionId]);
return TRUE;
}
}
diff --git a/web/report.php b/web/report.php
index 979beb6a..a7f42ba8 100755
--- a/web/report.php
+++ b/web/report.php
@@ -15,6 +15,8 @@ class Report
extract ($params);
+ \Vn\Lib\Locale::addPath ("reports/$reportName");
+
ob_start ();
include __DIR__.'/report.html.php';
$this->html = ob_get_contents ();
diff --git a/web/service.php b/web/service.php
index 8efcf23b..4afb6d24 100755
--- a/web/service.php
+++ b/web/service.php
@@ -77,6 +77,7 @@ abstract class Service
$_SESSION['lang'] = NULL;
Locale::set ($_SESSION['lang']);
+ Locale::addPath ('vn/web');
// Registering the visit
@@ -134,7 +135,7 @@ abstract class Service
function login ()
{
$db = $this->db;
- $user = NULL;
+ $anonymousUser = FALSE;
if (isset ($_POST['user']) && isset ($_POST['password']))
{
@@ -175,24 +176,29 @@ abstract class Service
);
}
else
+ {
$user = $db->getValue ('SELECT guest_user FROM config');
+ $anonymousUser = TRUE;
+ }
$db->query ('CALL account.userLoginWithName (#)', [$user]);
}
+ $userChanged = !$anonymousUser
+ && (empty ($_SESSION['user']) || $_SESSION['user'] != $user);
+
$_SESSION['user'] = $user;
// Registering the user access
- if (isset ($_SESSION['access'])
- && !isset ($_SESSION['visitUser']))
+ if (isset ($_SESSION['access']) && $userChanged)
{
- $_SESSION['visitUser'] = TRUE;
-
$db->query (
'CALL visitUserNew (#, #)',
[$_SESSION['access'], session_id ()]
);
+ error_log ($db->render ('CALL visitUserNew (#, #)',
+ [$_SESSION['access'], session_id ()]));
}
}
@@ -201,7 +207,6 @@ abstract class Service
**/
function logout ()
{
- unset ($_SESSION['visitUser']);
unset ($_SESSION['user']);
}
@@ -266,7 +271,7 @@ abstract class Service
[$_REQUEST['method']]);
if (!$isAuthorized)
- throw new UserException ('You don\'t have enough privileges');
+ throw new UserException (s('You don\'t have enough privileges'));
$methodDb = $db;
}
@@ -275,6 +280,8 @@ abstract class Service
if ($method::PARAMS !== NULL && !$method->checkParams ($_REQUEST, $method::PARAMS))
throw new UserException (s('Missing parameters'));
+
+ Locale::addPath ("rest/{$_REQUEST['method']}");
$res = $method->run ($methodDb);
$db->query ('CALL account.userLogout ()');