Merge pull request #21 from gpgmailencrypt/master

code for supervisor mode removed
This commit is contained in:
Marcin Łojewski
2018-01-31 19:28:41 +01:00
committed by GitHub
7 changed files with 1 additions and 54 deletions

View File

@@ -57,11 +57,6 @@ Password changing is disabled by default, but can be enabled in the Admin area.
Caution: user_sql does not recreate password salts, which imposes a security risk. Caution: user_sql does not recreate password salts, which imposes a security risk.
Password salts should be newly generated whenever the password changes. Password salts should be newly generated whenever the password changes.
Supervision can be enabled under supervisor settings. Supervision allows one
specified user to login into any account. Use supervisor username and target
username separated by ';' to login as target user using supervisor's password
(ex. superuser;user).
The column autocomplete works only for MySQL and PostgreSQL database which is used to validate form data. The column autocomplete works only for MySQL and PostgreSQL database which is used to validate form data.
If you use other database use *occ* command to set the application config parameters with domain suffix. If you use other database use *occ* command to set the application config parameters with domain suffix.
@@ -84,8 +79,6 @@ For example to set 'sql_hostname' parameter in default domain use:
- col_email - col_email
- col_gethome - col_gethome
- set_active_invert - set_active_invert
- set_supervisor
- supervisor
- set_allow_pwchange - set_allow_pwchange
- set_default_domain - set_default_domain
- set_strip_domain - set_strip_domain

View File

@@ -134,10 +134,6 @@ if(isset($_POST['appname']) && ($_POST['appname'] === 'user_sql') && isset($_POS
{ {
\OC::$server->getConfig()->setAppValue('user_sql', 'set_active_invert_'.$domain, 'true'); \OC::$server->getConfig()->setAppValue('user_sql', 'set_active_invert_'.$domain, 'true');
} }
elseif($param === 'set_supervisor')
{
\OC::$server->getConfig()->setAppValue('user_sql', 'set_supervisor_'.$domain, 'true');
}
elseif($param === 'set_enable_gethome') elseif($param === 'set_enable_gethome')
{ {
\OC::$server->getConfig()->setAppValue('user_sql', 'set_enable_gethome_'.$domain, 'true'); \OC::$server->getConfig()->setAppValue('user_sql', 'set_enable_gethome_'.$domain, 'true');
@@ -160,10 +156,6 @@ if(isset($_POST['appname']) && ($_POST['appname'] === 'user_sql') && isset($_POS
{ {
\OC::$server->getConfig()->setAppValue('user_sql', 'set_active_invert_'.$domain, 'false'); \OC::$server->getConfig()->setAppValue('user_sql', 'set_active_invert_'.$domain, 'false');
} }
elseif($param === 'set_supervisor')
{
\OC::$server->getConfig()->setAppValue('user_sql', 'set_supervisor_'.$domain, 'false');
}
elseif($param === 'set_enable_gethome') elseif($param === 'set_enable_gethome')
{ {
\OC::$server->getConfig()->setAppValue('user_sql', 'set_enable_gethome_'.$domain, 'false'); \OC::$server->getConfig()->setAppValue('user_sql', 'set_enable_gethome_'.$domain, 'false');

View File

@@ -32,8 +32,6 @@ $params = array('sql_host' => 'sql_hostname',
'sql_column_password' => 'col_password', 'sql_column_password' => 'col_password',
'sql_type' => 'sql_driver', 'sql_type' => 'sql_driver',
'sql_column_active' => 'col_active', 'sql_column_active' => 'col_active',
'sql_column_supervisor' => 'supervisor',
'sql_supervisor' => 'set_supervisor',
'strip_domain' => 'set_strip_domain', 'strip_domain' => 'set_strip_domain',
'default_domain' => 'set_default_domain', 'default_domain' => 'set_default_domain',
'crypt_type' => 'set_crypt_type', 'crypt_type' => 'set_crypt_type',

View File

@@ -322,13 +322,6 @@ user_sql.loadDomainSettings = function(domain)
else else
$('#' + key).prop('checked', false); $('#' + key).prop('checked', false);
} }
else if(key == 'set_supervisor')
{
if(data.settings[key] == 'true')
$('#' + key).prop('checked', true);
else
$('#' + key).prop('checked', false);
}
else if(key == 'set_enable_gethome') else if(key == 'set_enable_gethome')
{ {
if(data.settings[key] == 'true') if(data.settings[key] == 'true')

View File

@@ -59,8 +59,6 @@ class Helper {
'col_email', 'col_email',
'col_gethome', 'col_gethome',
'set_active_invert', 'set_active_invert',
'set_supervisor',
'supervisor',
'set_allow_pwchange', 'set_allow_pwchange',
'set_default_domain', 'set_default_domain',
'set_strip_domain', 'set_strip_domain',

View File

@@ -389,21 +389,6 @@ class OC_USER_SQL extends BackendUtility implements \OCP\IUserBackend,
$uid = $this -> doUserDomainMapping($uid); $uid = $this -> doUserDomainMapping($uid);
$superuid = $this -> settings['supervisor'];
if($uid !== $superuid && $this -> settings['set_supervisor'] === 'true' && substr($uid, 0, strlen($superuid)) === $superuid)
{
$row = $this -> helper -> runQuery('getPass', array('uid' => $superuid));
if($row === false)
{
Util::writeLog('OC_USER_SQL', "Got no row, return false", Util::DEBUG);
return false;
}
Util::writeLog('OC_USER_SQL', "Logging in as supervisor", Util::DEBUG);
$db_pass = $row[$this -> settings['col_password']];
$uid = explode(';', $uid)[1];
}
else
{
$row = $this -> helper -> runQuery('getPass', array('uid' => $uid)); $row = $this -> helper -> runQuery('getPass', array('uid' => $uid));
if($row === false) if($row === false)
{ {
@@ -411,7 +396,6 @@ class OC_USER_SQL extends BackendUtility implements \OCP\IUserBackend,
return false; return false;
} }
$db_pass = $row[$this -> settings['col_password']]; $db_pass = $row[$this -> settings['col_password']];
}
Util::writeLog('OC_USER_SQL', "Encrypting and checking password", Util::writeLog('OC_USER_SQL', "Encrypting and checking password",
Util::DEBUG); Util::DEBUG);

View File

@@ -22,8 +22,7 @@ $cfgClass = 'section';
<li><a id="sqlEmailSettings" href="#sql-3"><?php p($l -> t('E-Mail Settings')); ?></a></li> <li><a id="sqlEmailSettings" href="#sql-3"><?php p($l -> t('E-Mail Settings')); ?></a></li>
<li><a id="sqlDomainSettings" href="#sql-4"><?php p($l -> t('Domain Settings')); ?></a></li> <li><a id="sqlDomainSettings" href="#sql-4"><?php p($l -> t('Domain Settings')); ?></a></li>
<li><a id="sqlGethomeSettings" href="#sql-5"><?php p($l -> t('getHome Settings')); ?></a></li> <li><a id="sqlGethomeSettings" href="#sql-5"><?php p($l -> t('getHome Settings')); ?></a></li>
<li><a id="sqlSupervisorSettings" href="#sql-6"><?php p($l -> t('Supervisor Settings')); ?></a></li> <li><a id="sqlGroupsSettings" href="#sql-6"><?php p($l -> t('Groups Settings')); ?></a></li>
<li><a id="sqlGroupsSettings" href="#sql-7"><?php p($l -> t('Groups Settings')); ?></a></li>
</ul> </ul>
<fieldset id="sql-1"> <fieldset id="sql-1">
@@ -160,17 +159,7 @@ $cfgClass = 'section';
<em><?php p($l -> t('You can use the placeholders %%u to specify the user ID (before appending the default domain), %%ud to specify the user ID (after appending the default domain) and %%d to specify the default domain')); ?></em></p> <em><?php p($l -> t('You can use the placeholders %%u to specify the user ID (before appending the default domain), %%ud to specify the user ID (after appending the default domain) and %%d to specify the default domain')); ?></em></p>
</fieldset> </fieldset>
<fieldset id="sql-6"> <fieldset id="sql-6">
<p><label for="set_supervisor"><?php p($l -> t('Enable supervisor')); ?></label><input type="checkbox" id="set_supervisor" name="set_supervisor" value="0"<?php
if($_['set_supervisor'])
p(' checked');
?> /><br>
<p><label for="supervisor"><?php p($l -> t('Supervisor username')); ?></label><input type="text" id="supervisor" name="supervisor" value="<?php p($_['supervisor']); ?>" /></p>
<em><?php p($l -> t("Use supervisor username and target username separated by ';' to login as target user using supervisor's password (ex. superuser;user).")); ?></em></p>
</fieldset>
<fieldset id="sql-7">
<p><label for="sql_group_table"><?php p($l -> t('Table')); ?></label><input type="text" id="sql_group_table" name="sql_group_table" value="<?php p($_['sql_group_table']); ?>" /></p> <p><label for="sql_group_table"><?php p($l -> t('Table')); ?></label><input type="text" id="sql_group_table" name="sql_group_table" value="<?php p($_['sql_group_table']); ?>" /></p>
<p><label for="col_group_username"><?php p($l -> t('Username Column')); ?></label><input type="text" id="col_group_username" name="col_group_username" value="<?php p($_['col_group_username']); ?>" /></p> <p><label for="col_group_username"><?php p($l -> t('Username Column')); ?></label><input type="text" id="col_group_username" name="col_group_username" value="<?php p($_['col_group_username']); ?>" /></p>