* [FIX] Fixed bug on publick link availability detection

* [FIX] Fixed bug on viewing files for account from history
* [FIX] Fixed bug shen showing account request modification data
* [MOD] UI Tweaks
This commit is contained in:
nuxsmin
2017-01-13 12:06:56 +01:00
parent 75e6be4940
commit 47181be2cf
14 changed files with 47 additions and 31 deletions

View File

@@ -282,7 +282,7 @@ class AccountAcl
&& Acl::checkUserAccess(Acl::ACTION_ACC_EDIT);
// Mostrar acción de enlace público
$this->showLink = Checks::publicLinksIsEnabled() && Acl::checkUserAccess(Acl::ACTION_MGM_PUBLICLINKS);
$this->showLink = Checks::publicLinksIsEnabled() && Acl::checkUserAccess(Acl::ACTION_MGM_PUBLICLINKS_NEW);
// Mostrar acción de ver cuenta
$this->showView = $Acl->checkAccountAccess(Acl::ACTION_ACC_VIEW) && Acl::checkUserAccess(Acl::ACTION_ACC_VIEW);

View File

@@ -211,11 +211,10 @@ class AccountUtil
'SELECT account_id, account_name, customer_name ' .
'FROM accounts ' .
'LEFT JOIN customers ON customer_id = account_customerId ' .
'WHERE ' . implode(' AND ', $queryWhere);
'WHERE ' . implode(' AND ', $queryWhere) . ' ORDER BY customer_name';
$Data->setQuery($query);
return DB::getResultsArray($Data);
}
@@ -240,7 +239,7 @@ class AccountUtil
'SELECT account_id, account_name, customer_name ' .
'FROM accounts ' .
'LEFT JOIN customers ON customer_id = account_customerId ' .
'WHERE ' . implode(' AND ', $queryWhere);
'WHERE ' . implode(' AND ', $queryWhere) . ' ORDER BY customer_name';
$Data->setQuery($query);

View File

@@ -24,6 +24,7 @@
namespace SP\Controller;
use SP\Account\AccountUtil;
use SP\Core\ItemsTypeInterface;
use SP\DataModel\DataModelInterface;
use SP\Mgmt\Categories\Category;

View File

@@ -208,7 +208,15 @@ class MainController extends ControllerBase implements ActionsInterface
{
$this->view->addTemplate('sessionbar');
$this->view->assign('adminApp', $this->UserData->isUserIsAdminApp() ? '<span title="' . _('Admin Aplicación') . '">(A+)</span>' : '');
$userType = null;
if ($this->UserData->isUserIsAdminApp()) {
$userType = $this->icons->getIconAppAdmin();
} elseif ($this->UserData->isUserIsAdminAcc()) {
$userType = $this->icons->getIconAccAdmin();
}
$this->view->assign('userType', $userType);
$this->view->assign('userId', $this->UserData->getUserId());
$this->view->assign('userLogin', strtoupper($this->UserData->getUserLogin()));
$this->view->assign('userName', $this->UserData->getUserName() ?: strtoupper($this->view->userLogin));
@@ -498,7 +506,7 @@ class MainController extends ControllerBase implements ActionsInterface
{
$this->setPage('publiclink');
$this->view->addTemplate('body-header');
$this->view->addTemplate('body-header', 'main');
$hash = Request::analyze('h');
@@ -540,8 +548,8 @@ class MainController extends ControllerBase implements ActionsInterface
$this->showError(self::ERR_PAGE_NO_PERMISSION, false);
}
$this->view->addTemplate('body-footer');
$this->view->addTemplate('body-end');
$this->view->addTemplate('body-footer', 'main');
$this->view->addTemplate('body-end', 'main');
$this->view();
exit();

View File

@@ -38,4 +38,5 @@ interface ItemsTypeInterface
const ITEM_USERS = 5;
const ITEM_GROUPS = 6;
const ITEM_PROFILES = 7;
const ITEM_ACCOUNTS = 8;
}

View File

@@ -98,7 +98,10 @@ class UserPreferences extends UserPreferencesBase implements ItemInterface
/** @var UserData $queryRes */
$queryRes = DB::getResults($Data);
if ($queryRes === false || $queryRes->getUserPreferences() === null) {
if ($queryRes === false
|| $queryRes->getUserPreferences() === null
|| $queryRes->getUserPreferences() === ''
) {
return $this->getItemData();
}

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -191,7 +191,7 @@
<?php foreach ($otherAccounts as $otherAccount): ?>
<?php $selected = ($gotData && (int)$otherAccount->account_id === $accountData->getAccountParentId()) ? 'selected' : ''; ?>
<option value="<?php echo $otherAccount->account_id; ?>" <?php echo $selected; ?>><?php printf('%s (%s)', $otherAccount->account_name, $otherAccount->customer_name); ?></option>
<option value="<?php echo $otherAccount->account_id; ?>" <?php echo $selected; ?>><?php printf('%s - %s', $otherAccount->customer_name, $otherAccount->account_name); ?></option>
<?php endforeach; ?>
</select>
</td>
@@ -214,10 +214,10 @@
</tr>
<?php endif; ?>
<?php if ($actionId === \SP\Core\ActionsInterface::ACTION_ACC_EDIT && $accountData->getUserEditName()): ?>
<?php if ($actionId === \SP\Core\ActionsInterface::ACTION_ACC_EDIT && $isModified && $accountData->getUserEditName()): ?>
<tr>
<td class="descField"><?php echo _('Última Modificación'); ?></td>
<td class="valField"><?php echo $accountData->getAccountDateEdit(), ' ', _('por'), ' ', $accountData->getUserEditName(); ?></td>
<td class="valField"><?php printf('%s (%s)', $accountData->getAccountDateEdit(), $accountData->getUserEditName()); ?></td>
</tr>
<?php endif; ?>

View File

@@ -15,7 +15,7 @@
<td class="descField"><?php echo _('Archivos'); ?></td>
<td class="valField">
<div id="list-account-files"
data-item-id="<?php echo $accountIsHistory ? $accountParentId : $accountId; ?>"
data-item-id="<?php echo $accountId; ?>"
data-history="<?php $accountIsHistory; ?>"
data-delete="<?php echo (int)$AccountAcl->isShowDelete(); ?>"
data-sk="<?php echo $sk; ?>">

View File

@@ -16,15 +16,6 @@
<td class="descField"><?php echo _('Cliente'); ?></td>
<td class="valField"><?php echo $accountData->customer_name; ?></td>
</tr>
<tr>
<td class="descField"><?php echo _('URL / IP'); ?></td>
<td class="valField"><A href="<?php echo $accountData->getAccountUrl(); ?>"
target="_blank"><?php echo $accountData->getAccountUrl(); ?></td>
</tr>
<tr>
<td class="descField"><?php echo _('Usuario'); ?></td>
<td class="valField"><?php echo $accountData->getAccountLogin(); ?></td>
</tr>
<tr>
<td class="descField"><?php echo _('Petición'); ?></td>
<td class="valField">

View File

@@ -1,5 +1,5 @@
<?php if ($useLayout === true): ?>
</div> <!-- Close mdl-layout -->
</div> <!-- Close mdl-layout -->
<?php endif; ?>
</div> <!-- Close container -->
<footer>
@@ -9,6 +9,7 @@
<i id="btnLogout" class="material-icons">exit_to_app</i>
<span for="btnLogout"
class="mdl-tooltip mdl-tooltip--top"><?php echo _('Salir'); ?></span>
<?php if ($showPassIcon): ?>
<i id="btnUserPass" class="btn-action material-icons"
data-onclick="appMgmt/show"
@@ -33,12 +34,24 @@
class="mdl-tooltip mdl-tooltip--top"><?php printf(_('Hay %d notificaciones pendientes'), $userNotices); ?></span>
<?php else: ?>
<div id="notices-user" class="material-icons mdl-badge mdl-badge--overlap"
data-badge="0">notifications</div>
data-badge="0">notifications
</div>
<span for="notices-user"
class="mdl-tooltip mdl-tooltip--top"><?php echo _('No hay notificaciones pendientes'); ?></span>
class="mdl-tooltip mdl-tooltip--top"><?php echo _('No hay noInes pendientes'); ?></span>
<?php endif; ?>
<span id="user-info"><?php printf('%s (%s) %s', $userName, $userGroup, $adminApp); ?></span>
<span id="user-info">
<span id="user-name"><?php echo $userName; ?></span>
<span for="user-name"
class="mdl-tooltip mdl-tooltip--top"><?php printf('%s : %s', _('Grupo'), $userGroup); ?></span>
<?php /** @var \SP\Html\Assets\IconInterface $userType */
if ($userType !== null): ?>
<i id="user-type" class="material-icons"><?php echo $userType->getIcon(); ?></i>
<span for="user-type"
class="mdl-tooltip mdl-tooltip--top"><?php echo $userType->getTitle(); ?></span>
<?php endif; ?>
</span>
</div>
<?php endif; ?>
</div>

View File

@@ -157,7 +157,7 @@ sysPass.Actions = function (Common) {
* @param response
*/
var showImageBox = function ($obj, response) {
var $content = $("<div id=\"fancyContainer\" class=\"image\">" + response + "</div>");
var $content = $("<div id=\"box-popup\" class=\"image\">" + response + "</div>");
var $image = $content.find("img");
$image.hide();

View File

@@ -4,8 +4,8 @@ $jscomp.polyfill("Array.prototype.find",function(c){return c?c:function(c,h){ret
sysPass.Actions=function(c){var d=c.log,h=0,e={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",getUpdates:"/ajax/ajax_checkUpds.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",showPass:"/ajax/ajax_accViewPass.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",
search:"/ajax/ajax_noticeSearch.php"}},g=function(a){a={actionId:a.actionId,itemId:"undefined"!==a.itemId?a.itemId:0,isAjax:1};var b=c.appRequests().getRequestOpts();b.url=e.doAction;b.type="html";b.addHistory=!0;b.data=a;c.appRequests().getActionCall(b,function(a){$("#content").empty().html(a)})},n=function(a){d.info("updateItems");var b=$("#"+a.data("item-dst"))[0].selectize;b.clearOptions();b.load(function(b){var f=c.appRequests().getRequestOpts();f.url=e.updateItems;f.method="get";f.data={sk:c.sk.get(),
itemType:a.data("item-type")};c.appRequests().getActionCall(f,function(a){b(a.items)})})},l=function(a,b){$.magnificPopup.open({items:{src:b,type:"inline"},callbacks:{open:function(){c.appTriggers().views.common("#box-popup");$("#box-popup").find(":input:text:visible:first").focus()},close:function(){a.data("item-dst")&&n(a)}},showCloseBtn:!1})},r=function(a,b){var f=$('<div id="fancyContainer" class="image">'+b+"</div>"),d=f.find("img");d.hide();$.magnificPopup.open({items:{src:f,type:"inline"},
callbacks:{open:function(){var a=this;d.on("click",function(){a.close()});setTimeout(function(){var a=c.resizeImage(d);f.css({backgroundColor:"#fff",width:a.width,height:"auto"});d.show("slow")},500)}}})},q={logout:function(){var a=window.location.search;c.redirect(0<a.length?"index.php"+a+"&logout=1":"index.php?logout=1")},login:function(a){d.info("main:login");var b=c.appRequests().getRequestOpts();b.url=e.main.login;b.data=a.serialize();c.appRequests().getActionCall(b,function(b){switch(b.status){case 0:c.redirect(b.data.url);
itemType:a.data("item-type")};c.appRequests().getActionCall(f,function(a){b(a.items)})})},l=function(a,b){$.magnificPopup.open({items:{src:b,type:"inline"},callbacks:{open:function(){c.appTriggers().views.common("#box-popup");$("#box-popup").find(":input:text:visible:first").focus()},close:function(){a.data("item-dst")&&n(a)}},showCloseBtn:!1})},r=function(a,b){var f=$('<div id="box-popup" class="image">'+b+"</div>"),d=f.find("img");d.hide();$.magnificPopup.open({items:{src:f,type:"inline"},callbacks:{open:function(){var a=
this;d.on("click",function(){a.close()});setTimeout(function(){var a=c.resizeImage(d);f.css({backgroundColor:"#fff",width:a.width,height:"auto"});d.show("slow")},500)}}})},q={logout:function(){var a=window.location.search;c.redirect(0<a.length?"index.php"+a+"&logout=1":"index.php?logout=1")},login:function(a){d.info("main:login");var b=c.appRequests().getRequestOpts();b.url=e.main.login;b.data=a.serialize();c.appRequests().getActionCall(b,function(b){switch(b.status){case 0:c.redirect(b.data.url);
break;case 2:c.msg.out(b);a.find("input[type='text'],input[type='password']").val("");a.find("input:first").focus();b=$(".extra-hidden");0<b.length&&b.hide();$("#mpass").prop("disabled",!1).val("");$("#smpass").show();break;case 5:c.msg.out(b);a.find("input[type='text'],input[type='password']").val("");a.find("input:first").focus();b=$(".extra-hidden");0<b.length&&b.hide();$("#oldpass").prop("disabled",!1).val("");$("#soldpass").show();break;default:c.msg.out(b),a.find("input[type='text'],input[type='password']").val(""),
a.find("input:first").focus()}})},install:function(a){d.info("main:install");var b=c.appRequests().getRequestOpts();b.url=e.main.install;b.data=a.serialize();c.appRequests().getActionCall(b,function(a){c.msg.out(a);0==a.status&&setTimeout(function(){c.redirect("index.php")},1E3)})},getUpdates:function(a){d.info("main:getUpdates");a=c.appRequests().getRequestOpts();a.url=e.main.getUpdates;a.type="html";a.method="get";a.timeout=1E4;a.useLoading=!1;a.data={isAjax:1};c.appRequests().getActionCall(a,function(a){$("#updates").html(a);
"undefined"!==typeof componentHandler&&componentHandler.upgradeDom()},function(){$("#updates").html("!")})}},m={show:function(a){d.info("account:show");g({actionId:a.data("action-id"),itemId:a.data("item-id")})},showHistory:function(a){d.info("account:showHistory");g({actionId:a.data("action-id"),itemId:a.val()})},edit:function(a){d.info("account:edit");g({actionId:a.data("action-id"),itemId:a.data("item-id")})},"delete":function(a){d.info("account:delete");var b='<div id="alert"><p id="alert-text">'+