Skip to content

Commit

Permalink
* [FIX] Fixed issue when searching an user groupmembership to access …
Browse files Browse the repository at this point in the history
…to an account. Thanks to @basil-twisleton

* [FIX] Closes #157. Fixed issue when adding LDAP users that don't have any default group/profile set, they are disabled. Thanks to @CyrosX
* [FIX] Closes #154. Modified a string in the ldap template. Thanks to @tsener
* [MOD] Changed default behavior when creating a new account. Now a blank form is displayed. Thanks to @basil-twisleton
* [MOD] Closes #155. Extensions cannot contain other characters than "A-Z", "0-9", "_" and "-". Thanks to @tsener
  • Loading branch information
nuxsmin committed Oct 22, 2015
1 parent adb5d06 commit 9451281
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 19 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
=== ** v1.2.0.07 ===

* [FIX] Fixed issue when searching an user groupmembership to access to an account. Thanks to @basil-twisleton
* [FIX] Closes #157. Fixed issue when adding LDAP users that don't have any default group/profile set, they are disabled. Thanks to @CyrosX
* [FIX] Closes #154. Modified a string in the ldap template. Thanks to @tsener
* [MOD] Changed default behavior when creating a new account. Now a blank form is displayed. Thanks to @basil-twisleton
* [MOD] Closes #155. Extensions cannot contain other characters than "A-Z", "0-9", "_" and "-". Thanks to @tsener

=== ** v1.2.0.06 ===

* [ADD] New language translation to Catalan. Thanks to @ferrergl
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG-ES
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
=== ** v1.2.0.07 ===

* [FIX] Arreglado error cuando se obtenía la pertenencia a grupos de un usuario para acceder a una cuenta. Thanks to @basil-twisleton
* [FIX] Closes #157. Arreglado error cuando se añaden usuarios desde LDAP que no tienen grupo o perfil por defecto, son deshabilitados. Thanks to @CyrosX
* [FIX] Closes #154. Modificada cadena en la plantilla de LDAP. Thanks to @tsener
* [MOD] Cambiado comportamiento al crear una nueva cuenta. Ahora se muestra un formularion en blanco. Thanks to @basil-twisleton
* [MOD] Closes #155. Las extensiones sólo pueden contener los siguientes caracteres: "A-Z", "0-9", "_" and "-". Thanks to @tsener

=== ** v1.2.0.06 ===

* [ADD] Nueva traducción al catalán. Gracias a @ferrergl
Expand Down
18 changes: 14 additions & 4 deletions ajax/ajax_configSave.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,24 @@
$filesAllowedSize = SP\Request::analyze('files_allowed_size', 1024);
$filesAllowedExts = SP\Request::analyze('files_allowed_exts');

SP\Config::setCacheConfigValue('files_enabled', $filesEnabled);
SP\Config::setCacheConfigValue('files_allowed_size', $filesAllowedSize);
SP\Config::setCacheConfigValue('files_allowed_exts', $filesAllowedExts);

if ($filesEnabled && $filesAllowedSize >= 16384) {
SP\Response::printJSON(_('El tamaño máximo por archivo es de 16MB'));
}

if (!empty($filesAllowedExts)){
$exts = explode(',', $filesAllowedExts);

array_walk($exts, function(&$value) {
if (preg_match('/[^a-z0-9_-]+/i', $value)) {
SP\Response::printJSON(_('Extensión no permitida'));
}
});
}

SP\Config::setCacheConfigValue('files_enabled', $filesEnabled);
SP\Config::setCacheConfigValue('files_allowed_size', $filesAllowedSize);
SP\Config::setCacheConfigValue('files_allowed_exts', $filesAllowedExts);

// Proxy
$proxyEnabled = SP\Request::analyze('proxy_enabled', false, false, true);
$proxyServer = SP\Request::analyze('proxy_server');
Expand Down
12 changes: 7 additions & 5 deletions inc/Acl.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,15 @@ public static function checkAccountAccess($module, $accountData)
$userId = Session::getUserId();
$userIsAdminApp = Session::getUserIsAdminApp();
$userIsAdminAcc = Session::getUserIsAdminAcc();
$userToGroups = false;
$userToGroups = in_array($userGroupId,Groups::getUsersForGroup($accountData['group_id']));

foreach($accountData['groups_id'] as $groupId){
$users = Groups::getUsersForGroup($groupId);
if ($userToGroups === false) {
foreach ($accountData['groups_id'] as $groupId) {
$users = Groups::getUsersForGroup($groupId);

if ($userGroupId === $groupId || in_array($userId, $users)){
$userToGroups = true;
if ($userGroupId === $groupId || in_array($userId, $users)) {
$userToGroups = true;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions inc/UserLdap.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public static function newUserLDAP(User $User)
$data['pass'] = $passdata['pass'];
$data['hashSalt'] = $passdata['salt'];
$data['email'] = $User->getUserEmail();
$data['notes'] = 'LDAP';
$data['notes'] = _('Usuario de LDAP');
$data['groupId'] = $groupId;
$data['profileId'] = $profileId;
$data['isDisabled'] = ($groupId && $profileId);
$data['isDisabled'] = (int)($groupId && $profileId);

if (DB::getQuery($query, __FUNCTION__, $data) === false) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion inc/Util.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public static function curlIsAvailable()
*/
public static function getVersion($retBuild = false)
{
$build = '06';
$build = '07';
$version = array(1, 2, 0);

if ($retBuild) {
Expand Down
2 changes: 1 addition & 1 deletion inc/themes/material-blue/css/styles.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inc/themes/material-blue/ldap.inc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<input id="ldap_binduser" name="ldap_binduser" type="text"
class="mdl-textfield__input fg-blue100"
maxlength="128" value="<?php echo $ldapBindUser; ?>" <?php echo $isDisabled; ?>/>
<label class="mdl-textfield__label" for="ldap_binduser"><?php echo _('Servidor'); ?></label>
<label class="mdl-textfield__label" for="ldap_binduser"><?php echo _('Usuario'); ?></label>
</div>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions inc/themes/material-blue/searchbox.inc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="searchbox">
<div id="searchbox" class="round shadow">
<form method="post" name="frmSearch" id="frmSearch" OnSubmit="return sysPassUtil.Common.accSearch(0);">
<div id="tblTools" class="round shadow">
<div id="tblTools">
<div id="toolsLeft">
<i id="btnClear" class="material-icons" title="<?php echo _('Limpiar'); ?>">clear_all</i>

Expand Down
2 changes: 2 additions & 0 deletions js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ sysPass.Util.Common = function () {

if (action && id) {
doAction(action, 1, id);
} else if (action) {
doAction(action, 1);
}
} else if (status === 10) {
doLogout();
Expand Down
2 changes: 1 addition & 1 deletion js/functions.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/AccountC.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getNewAccount()
)
);
$this->view->assign('showform', true);
$this->view->assign('nextaction', Acl::ACTION_ACC_SEARCH);
$this->view->assign('nextaction', Acl::ACTION_ACC_NEW);

Session::setLastAcountId(0);
$this->setCommonData();
Expand Down
2 changes: 1 addition & 1 deletion web/UsersMgmtC.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ public function getUser()
$this->_module = self::ACTION_USR_USERS;
$this->view->addTemplate('users');

$this->view->assign('isDisabled', ($this->view->isDemo || $this->view->actionId === self::ACTION_USR_USERS_VIEW) ? 'disabled' : '');
$this->view->assign('user', UserUtil::getUserData($this->view->itemId));
$this->view->assign('isDisabled', (($this->view->user['user_login'] === 'demo' && $this->view->isDemo) || $this->view->actionId === self::ACTION_USR_USERS_VIEW) ? 'disabled' : '');
$this->view->assign('groups', DB::getValuesForSelect('usrGroups', 'usergroup_id', 'usergroup_name'));
$this->view->assign('profiles', DB::getValuesForSelect('usrProfiles', 'userprofile_id', 'userprofile_name'));
$this->view->assign('ro', ($this->view->user['checks']['user_isLdap']) ? 'READONLY' : '');
Expand Down

0 comments on commit 9451281

Please sign in to comment.