Skip to content

Commit c913d19

Browse files
committed
Revert appid, update.php. Add changelog file
1 parent 45195bc commit c913d19

File tree

3 files changed

+93
-4
lines changed

3 files changed

+93
-4
lines changed

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5+
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6+
7+
## [2.4.0] - 2017-12-26
8+
### Added
9+
- This CHANGELOG.md file
10+
- Support for PHP 7
11+
- SHA1 hash algorithm support
12+
- Groups option
13+
- Supervisor option
14+
15+
### Changed
16+
- Supported version of ownCloud, Nextcloud: ownCloud 10, Nextcloud 12

appinfo/info.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0"?>
22
<info>
3-
<id>user_sql_2</id>
4-
<name>SQL user backend 2</name>
3+
<id>user_sql</id>
4+
<name>SQL user backend</name>
55
<summary>Authenticate users by SQL queries.</summary>
66
<description>Authenticate users by SQL queries.</description>
7-
<version>1.0.0</version>
7+
<version>2.4.0</version>
88
<licence>agpl</licence>
99
<author>Andreas Boehler &lt;dev (at) aboehler (dot) at &gt;</author>
1010
<namespace>user_sql</namespace>
1111
<bugs>https://github.com/mlojewski-me/user_sql/issues</bugs>
1212
<repository>https://github.com/mlojewski-me/user_sql</repository>
13-
<screenshot>https://raw.githubusercontent.com/mlojewski-me/user_sql/2_v1.0.0/screenshot.png</screenshot>
13+
<screenshot>https://raw.githubusercontent.com/mlojewski-me/user_sql/v2.4.0/screenshot.png</screenshot>
1414
<types>
1515
<authentication/>
1616
</types>

appinfo/update.php

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
/**
4+
* ownCloud - user_sql
5+
*
6+
* @author Andreas Böhler and contributors
7+
* @copyright 2012-2015 Andreas Böhler <dev (at) aboehler (dot) at>
8+
*
9+
* This library is free software; you can redistribute it and/or
10+
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11+
* License as published by the Free Software Foundation; either
12+
* version 3 of the License, or any later version.
13+
*
14+
* This library is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18+
*
19+
* You should have received a copy of the GNU Affero General Public
20+
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
21+
*
22+
*/
23+
24+
$installedVersion = \OC::$server->getConfig()->getAppValue('user_sql', 'installed_version');
25+
26+
$params = array('sql_host' => 'sql_hostname',
27+
'sql_user' => 'sql_username',
28+
'sql_database' => 'sql_database',
29+
'sql_password' => 'sql_password',
30+
'sql_table' => 'sql_table',
31+
'sql_column_username' => 'col_username',
32+
'sql_column_password' => 'col_password',
33+
'sql_type' => 'sql_driver',
34+
'sql_column_active' => 'col_active',
35+
'sql_column_supervisor' => 'supervisor',
36+
'sql_supervisor' => 'set_supervisor',
37+
'strip_domain' => 'set_strip_domain',
38+
'default_domain' => 'set_default_domain',
39+
'crypt_type' => 'set_crypt_type',
40+
'sql_column_displayname' => 'col_displayname',
41+
'allow_password_change' => 'set_allow_pwchange',
42+
'sql_column_active_invert' => 'set_active_invert',
43+
'sql_column_email' => 'col_email',
44+
'mail_sync_mode' => 'set_mail_sync_mode'
45+
);
46+
47+
$delParams = array('domain_settings',
48+
'map_array',
49+
'domain_array'
50+
);
51+
52+
if(version_compare($installedVersion, '1.99', '<'))
53+
{
54+
foreach($params as $oldPar => $newPar)
55+
{
56+
$val = \OC::$server->getConfig()->getAppValue('user_sql', $oldPar);
57+
if(($oldPar === 'strip_domain') || ($oldPar === 'allow_password_change') || ($oldPar === 'sql_column_active_invert'))
58+
{
59+
if($val)
60+
$val = 'true';
61+
else
62+
$val = 'false';
63+
}
64+
if($val)
65+
\OC::$server->getConfig()->setAppValue('user_sql', $newPar.'_default', $val);
66+
\OC::$server->getConfig()->deleteAppValue('user_sql', $oldPar);
67+
}
68+
69+
foreach($delParams as $param)
70+
{
71+
\OC::$server->getConfig()->deleteAppValue('user_sql', $param);
72+
}
73+
}

0 commit comments

Comments
 (0)