* [FIX] Accounts history was not checked for missing groups Id. Related #466. Thanks to @Yotouille for the feedback

* [FIX] Ajax requests were not detected in some environments. Related #466. Thanks to @lukasp2 for the feedback
+ [MOD] Modified tab behavior when tabbing through account form fields.
This commit is contained in:
nuxsmin
2017-03-02 13:09:11 +01:00
parent 81cc9e38db
commit 0271d2b564
8 changed files with 39 additions and 19 deletions

View File

@@ -42,11 +42,13 @@ class Check
{
$query = /** @lang SQL */
'SELECT * FROM
(SELECT COUNT(*) AS accounts_user FROM accounts WHERE account_userId NOT IN (SELECT user_id FROM usrData) OR account_userId IS NULL) a,
(SELECT COUNT(*) AS accounts_user FROM accounts WHERE account_userId NOT IN (SELECT user_id FROM usrData) OR account_userId IS NULL) au,
(SELECT COUNT(*) AS accounts_group FROM accounts WHERE account_userGroupId NOT IN (SELECT usergroup_id FROM usrGroups) OR account_userGroupId IS NULL) ag,
(SELECT COUNT(*) AS accounts_useredit FROM accounts WHERE account_userEditId NOT IN (SELECT user_id FROM usrData) OR account_userEditId IS NULL) b,
(SELECT COUNT(*) AS accounts_category FROM accounts WHERE account_categoryId NOT IN (SELECT category_id FROM categories) OR account_categoryId IS NULL) c,
(SELECT COUNT(*) AS accounts_customer FROM accounts WHERE account_customerId NOT IN (SELECT customer_id FROM customers) OR account_customerId IS NULL) d,
(SELECT COUNT(*) AS accountshistory_user FROM accHistory WHERE acchistory_userId NOT IN (SELECT user_id FROM usrData) OR acchistory_userId IS NULL) e,
(SELECT COUNT(*) AS accountshistory_user FROM accHistory WHERE acchistory_userId NOT IN (SELECT user_id FROM usrData) OR acchistory_userId IS NULL) eu,
(SELECT COUNT(*) AS accountshistory_group FROM accHistory WHERE acchistory_userGroupId NOT IN (SELECT usergroup_id FROM usrGroups) OR acchistory_userGroupId IS NULL) eg,
(SELECT COUNT(*) AS accountshistory_useredit FROM accHistory WHERE acchistory_userEditId NOT IN (SELECT user_id FROM usrData) OR acchistory_userEditId IS NULL) f,
(SELECT COUNT(*) AS accountshistory_category FROM accHistory WHERE acchistory_categoryId NOT IN (SELECT category_id FROM categories) OR acchistory_categoryId IS NULL) g,
(SELECT COUNT(*) AS accountshistory_customer FROM accHistory WHERE acchistory_customerId NOT IN (SELECT customer_id FROM customers) OR acchistory_customerId IS NULL) h,

View File

@@ -59,11 +59,23 @@ class Group
}
$Data = new QueryData();
$Data->addParam($groupId);
$query = /** @lang SQL */
'UPDATE accounts SET account_userGroupId = ? WHERE account_userGroupId NOT IN (SELECT usergroup_id FROM usrGroups ORDER BY usergroup_id) OR account_userGroupId IS NULL';
$Data->setQuery($query);
DB::getQuery($Data);
$query = /** @lang SQL */
'UPDATE accHistory SET acchistory_userGroupId = ? WHERE acchistory_userGroupId NOT IN (SELECT usergroup_id FROM usrGroups ORDER BY usergroup_id) OR acchistory_userGroupId IS NULL';
$Data->setQuery($query);
DB::getQuery($Data);
$query = /** @lang SQL */
'UPDATE usrData SET user_groupId = ? WHERE user_groupId NOT IN (SELECT usergroup_id FROM usrGroups ORDER BY usergroup_id) OR user_groupId IS NULL';
$Data->setQuery($query);
$Data->addParam($groupId);
DB::getQuery($Data);

View File

@@ -303,7 +303,8 @@ class Checks
*/
public static function isAjax()
{
return Request::getRequestHeaders('X-Requested-With') === 'XMLHttpRequest';
return Request::getRequestHeaders('X-Requested-With') === 'XMLHttpRequest'
|| Request::analyze('isAjax', false, true);
}
/**

View File

@@ -372,7 +372,7 @@ class Util
*/
public static function getVersion($retBuild = false)
{
$build = '17022601';
$build = '17030201';
$version = [2, 1, 0];
if ($retBuild) {

View File

@@ -44,7 +44,8 @@
<input id="name" name="name" type="text" required
class="mdl-textfield__input mdl-color-text--indigo-400"
maxlength="50"
value="<?php echo $gotData ? $accountData->getAccountName() : ''; ?>" <?php echo $readonly; ?>>
value="<?php echo $gotData ? $accountData->getAccountName() : ''; ?>" <?php echo $readonly; ?>
tabindex="1">
<label class="mdl-textfield__label" for="name"><?php echo __('Nombre de cuenta'); ?></label>
</div>
</td>
@@ -55,7 +56,7 @@
<div class="lowres-title"><?php echo __('Cliente'); ?></div>
<select id="selCustomer" name="customerId" class="select-box sel-chosen-customer"
required <?php echo $disabled; ?>>
tabindex="2" required <?php echo $disabled; ?>>
<option value=""><?php echo __('Seleccionar Cliente'); ?></option>
<?php foreach ($customers as $customer): ?>
<option
@@ -78,7 +79,7 @@
<div class="lowres-title"><?php echo __('Categoría'); ?></div>
<select id="selCategory" name="categoryId" class="select-box sel-chosen-category"
required <?php echo $disabled; ?>>
tabindex="3" required <?php echo $disabled; ?>>
<option value=""><?php echo __('Seleccionar Categoría'); ?></option>
<?php foreach ($categories as $category): ?>
<option
@@ -100,7 +101,7 @@
<td class="valField">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input id="url" name="url" type="text" class="mdl-textfield__input mdl-color-text--indigo-400"
maxlength="255"
maxlength="255" tabindex="4"
value="<?php echo $gotData ? $accountData->getAccountUrl() : ''; ?>" <?php echo $readonly; ?>>
<label class="mdl-textfield__label" for="name"><?php echo __('URL o IP de acceso'); ?></label>
</div>
@@ -112,7 +113,7 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input id="login" name="login" type="text"
class="mdl-textfield__input mdl-color-text--indigo-400"
maxlength="50"
maxlength="50" tabindex="5"
value="<?php echo $gotData ? $accountData->getAccountLogin() : ''; ?>" <?php echo $readonly; ?>>
<label class="mdl-textfield__label" for="name"><?php echo __('Usuario de acceso'); ?></label>
</div>
@@ -125,7 +126,7 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input id="accountpass" name="pass" type="password" required
class="mdl-textfield__input mdl-color-text--indigo-400 passwordfield__input"
maxlength="255"
maxlength="255" tabindex="6"
autocomplete="off">
<label class="mdl-textfield__label" for="accountpass"><?php echo __('Clave'); ?></label>
</div>
@@ -137,7 +138,7 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input id="accountpassR" name="passR" type="password" required
class="mdl-textfield__input mdl-color-text--indigo-400"
maxlength="255" autocomplete="off">
tabindex="7" maxlength="255" autocomplete="off">
<label class="mdl-textfield__label"
for="accountpassR"><?php echo __('Clave (repetir)'); ?></label>
</div>
@@ -151,6 +152,7 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input id="accountpassdatechange" name="accountpassdatechange" type="date"
class="mdl-textfield__input mdl-color-text--indigo-400 password-datefield__input"
tabindex="8"
value="<?php echo $accountPassDateChange; ?>" <?php echo $readonly; ?>>
<label class="mdl-textfield__label"
for="accountpassdatechange"><?php echo __('Fecha'); ?></label>
@@ -166,7 +168,7 @@
<td class="valField">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<textarea class="mdl-textfield__input mdl-color-text--indigo-400" rows="3" id="notes"
name="notes"
name="notes" tabindex="9"
maxlength="1000" <?php echo $readonly; ?>><?php echo $gotData ? $accountData->getAccountNotes() : ''; ?></textarea>
<label class="mdl-textfield__label"
for="notes"><?php echo __('Notas sobre la cuenta'); ?></label>
@@ -178,7 +180,7 @@
<div class="lowres-title"><?php echo __('Etiquetas'); ?></div>
<?php if (!$isView): ?>
<select id="selTags" name="tags[]" multiple="multiple">
<select id="selTags" name="tags[]" multiple="multiple" tabindex="10">
<option value=""><?php echo __('Seleccionar Etiquetas'); ?></option>
</select>
<?php else: ?>
@@ -194,7 +196,7 @@
<td class="valField">
<div class="lowres-title"><?php echo __('Cuenta Vinculada'); ?></div>
<select id="selParentAccount" name="parentAccountId"
<select id="selParentAccount" name="parentAccountId" tabindex="11"
class="select-box select-box-deselect" <?php echo $disabled; ?>
data-sk="<?php echo $sk; ?>"
data-item-type="<?php echo \SP\Core\ItemsTypeInterface::ITEM_ACCOUNTS_USER; ?>"
@@ -211,7 +213,7 @@
<td class="valField">
<div class="lowres-title"><?php echo __('Historial'); ?></div>
<select id="historyId" name="historyId" class="select-box"
<select id="historyId" name="historyId" class="select-box" tabindex="12"
data-action-id="<?php echo SP\Core\ActionsInterface::ACTION_ACC_VIEW_HISTORY; ?>"
data-onchange="account/showHistory">
<option value=""><?php echo __('Seleccionar fecha'); ?></option>

View File

@@ -84,7 +84,10 @@
</div>
<?php endif; ?>
<?php if ($checkConstraints->users_group > 0): ?>
<?php if ($checkConstraints->users_group > 0
|| $checkConstraints->accounts_group > 0
|| $checkConstraints->accountshistory_group > 0
): ?>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input id="groupid" name="groupid" type="number"
class="mdl-textfield__input mdl-color-text--indigo-400"

View File

@@ -1,5 +1,5 @@
var $jscomp={scope:{},findInternal:function(c,d,k){c instanceof String&&(c=String(c));for(var f=c.length,g=0;g<f;g++){var l=c[g];if(d.call(k,l,g,c))return{i:g,v:l}}return{i:-1,v:void 0}}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(c,d,k){if(k.get||k.set)throw new TypeError("ES3 does not support getters and setters.");c!=Array.prototype&&c!=Object.prototype&&(c[d]=k.value)};
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,d,k,f){if(d){k=$jscomp.global;c=c.split(".");for(f=0;f<c.length-1;f++){var g=c[f];g in k||(k[g]={});k=k[g]}c=c[c.length-1];f=k[c];d=d(f);d!=f&&null!=d&&$jscomp.defineProperty(k,c,{configurable:!0,writable:!0,value:d})}};
$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(c,d,k,f){if(d){k=$jscomp.global;c=c.split(".");for(f=0;f<c.length-1;f++){var g=c[f];g in k||(k[g]={});k=k[g]}c=c[c.length-1];f=k[c];d=d(f);d!=f&&null!=d&&$jscomp.defineProperty(k,c,{configurable:!0,writable:!0,value:d})}};
$jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,k){return $jscomp.findInternal(this,c,k).v}},"es6-impl","es3");
sysPass.Actions=function(c){var d=c.log,k=0,f={doAction:"/ajax/ajax_getContent.php",updateItems:"/ajax/ajax_getItems.php",user:{savePreferences:"/ajax/ajax_userPrefsSave.php",password:"/ajax/ajax_usrpass.php",passreset:"/ajax/ajax_passReset.php"},main:{login:"/ajax/ajax_doLogin.php",install:"/ajax/ajax_install.php",upgrade:"/ajax/ajax_upgrade.php",getUpdates:"/ajax/ajax_checkUpds.php",task:"/ajax/ajax_task.php"},checks:"/ajax/ajax_checkConnection.php",config:{save:"/ajax/ajax_configSave.php","export":"/ajax/ajax_configSave.php",
"import":"/ajax/ajax_configSave.php"},file:"/ajax/ajax_filesMgmt.php",link:"/ajax/ajax_itemSave.php",plugin:"/ajax/ajax_itemSave.php",account:{save:"/ajax/ajax_itemSave.php",saveFavorite:"/ajax/ajax_itemSave.php",request:"/ajax/ajax_itemSave.php",getFiles:"/ajax/ajax_accGetFiles.php",search:"/ajax/ajax_accSearch.php"},appMgmt:{show:"/ajax/ajax_itemShow.php",save:"/ajax/ajax_itemSave.php",search:"/ajax/ajax_itemSearch.php"},eventlog:"/ajax/ajax_eventlog.php",wiki:{show:"/ajax/ajax_wiki.php"},notice:{show:"/ajax/ajax_noticeShow.php",

View File

@@ -1,5 +1,5 @@
var $jscomp={scope:{},checkStringArgs:function(b,d,c){if(null==b)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(d instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return b+""}};
$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(b,d,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");b!=Array.prototype&&b!=Object.prototype&&(b[d]=c.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global?global:b};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(b,d,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");b!=Array.prototype&&b!=Object.prototype&&(b[d]=c.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(b,d,c,e){if(d){c=$jscomp.global;b=b.split(".");for(e=0;e<b.length-1;e++){var a=b[e];a in c||(c[a]={});c=c[a]}b=b[b.length-1];e=c[b];d=d(e);d!=e&&null!=d&&$jscomp.defineProperty(c,b,{configurable:!0,writable:!0,value:d})}};
$jscomp.polyfill("String.prototype.startsWith",function(b){return b?b:function(b,c){var d=$jscomp.checkStringArgs(this,b,"startsWith");b+="";for(var a=d.length,h=b.length,g=Math.max(0,Math.min(c|0,d.length)),f=0;f<h&&g<a;)if(d[g++]!=b[f++])return!1;return f>=h}},"es6-impl","es3");
sysPass.Requests=function(b){var d=b.log,c=[],e={get:function(){return c},add:function(a){var b=""===a.hash?SparkMD5.hash(JSON.stringify(a),!1):a.hash;if(0<c.length&&c[c.length-1].hash===b)return c;d.info("history:add");a.hash=b;c.push(a);15<=c.length&&c.splice(0,10);return c},del:function(){d.info("history:del");if("undefined"!==typeof c.pop())return c[c.length-1]},reset:function(){d.info("history:reset");c=[]},length:function(){return c.length}};return{getRequestOpts:function(){return Object.create({type:"json",