aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2010-12-14 14:36:20 +0000
committerpatdenice <patdenice@piwigo.org>2010-12-14 14:36:20 +0000
commite97974a42e64ee43d95cef258d65d9b022929dbe (patch)
tree00cef9ee9212ae653a8e266a2db51ad3dbe6c39b
parent21fe811c3b773af20a9e9d9932274cae16111cb1 (diff)
feature 2060: Remove adviser from db structure.
Remove adviser from user_list page and some db queries. git-svn-id: http://piwigo.org/svn/trunk@8131 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/cat_list.php2
-rw-r--r--admin/themes/default/default-colors.css2
-rw-r--r--admin/themes/default/template/extend_for_templates.tpl2
-rw-r--r--admin/themes/default/template/user_list.tpl13
-rw-r--r--admin/user_list.php22
-rw-r--r--include/functions_mail.inc.php1
-rw-r--r--install/db/91-database.php2
-rw-r--r--install/piwigo_structure-mysql.sql1
-rw-r--r--install/piwigo_structure-pdo-sqlite.sql1
-rw-r--r--install/piwigo_structure-pgsql.sql1
-rw-r--r--install/piwigo_structure-sqlite.sql1
-rw-r--r--password.php8
-rw-r--r--themes/default/theme.css2
13 files changed, 7 insertions, 51 deletions
diff --git a/admin/cat_list.php b/admin/cat_list.php
index 98dfecc03..e485a3d21 100644
--- a/admin/cat_list.php
+++ b/admin/cat_list.php
@@ -102,7 +102,7 @@ $navigation.= '</a>';
// +-----------------------------------------------------------------------+
// | virtual categories management |
// +-----------------------------------------------------------------------+
-// request to delete a virtual category / not for an adviser
+// request to delete a virtual category
if (isset($_GET['delete']) and is_numeric($_GET['delete']))
{
delete_categories(array($_GET['delete']));
diff --git a/admin/themes/default/default-colors.css b/admin/themes/default/default-colors.css
index d786a9d33..915df5a9b 100644
--- a/admin/themes/default/default-colors.css
+++ b/admin/themes/default/default-colors.css
@@ -29,7 +29,7 @@ INPUT.radio, INPUT.checkbox {
/**
- * Header message like upgrade or adviser mode
+ * Header message like upgrade
*/
.header_msgs {
text-align:center;
diff --git a/admin/themes/default/template/extend_for_templates.tpl b/admin/themes/default/template/extend_for_templates.tpl
index bbaa48b5c..07998128a 100644
--- a/admin/themes/default/template/extend_for_templates.tpl
+++ b/admin/themes/default/template/extend_for_templates.tpl
@@ -28,10 +28,8 @@
</tr>
{/foreach}
</table>
- {if !is_adviser()}
<p>
<input class="submit" type="submit" value="{'Submit'|@translate}" name="submit">
</p>
- {/if}
</form>
{/if}
diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl
index ec0fd29f3..03772e104 100644
--- a/admin/themes/default/template/user_list.tpl
+++ b/admin/themes/default/template/user_list.tpl
@@ -120,19 +120,6 @@
</select>
</td>
</tr>
-
- {if isset($adviser)}
- <tr>
- <td>{'Adviser'|@translate}</td>
- <td>
- <label><input type="radio" name="adviser" value="leave" checked="checked"> {'leave'|@translate}</label>
- / {'set to'|@translate}
- <label><input type="radio" name="adviser" value="true">{'Yes'|@translate}</label>
- <label><input type="radio" name="adviser" value="false">{'No'|@translate}</label>
- </td>
- </tr>
- {/if}
-
</table>
</fieldset>
diff --git a/admin/user_list.php b/admin/user_list.php
index fb220753c..9e28415c9 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -86,7 +86,6 @@ SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
u.'.$conf['user_fields']['username'].' AS username,
u.'.$conf['user_fields']['email'].' AS email,
ui.status,
- ui.adviser,
ui.enabled_high,
ui.level
FROM '.USERS_TABLE.' AS u
@@ -392,11 +391,6 @@ DELETE FROM '.USER_GROUP_TABLE.'
$true_false_fields = array('expand', 'show_nb_comments',
'show_nb_hits', 'enabled_high');
- if ($conf['allow_adviser'])
- {
- array_push($formfields, 'adviser');
- array_push($true_false_fields, 'adviser');
- }
foreach ($formfields as $formfield)
{
@@ -458,12 +452,6 @@ DELETE FROM '.USER_GROUP_TABLE.'
$data['status'] = 'guest';
}
}
-
- // could not be adivser
- if (isset($data['adviser']))
- {
- $data['adviser'] = 'false';
- }
}
array_push($datas, $data);
@@ -523,12 +511,6 @@ $template->assign(
'F_FILTER_ACTION' => get_root_url().'admin.php'
));
-// Hide radio-button if not allow to assign adviser
-if ($conf['allow_adviser'])
-{
- $template->assign('adviser', true);
-}
-
// Display or Hide double password type
$template->assign('Double_Password', $conf['double_password_type_in_admin'] );
@@ -707,9 +689,7 @@ foreach ($visible_user_list as $local_user)
? '<br>['.l10n('guest').']' : '')
.($local_user['id'] == $conf['default_user_id']
? '<br>['.l10n('default values').']' : ''),
- 'STATUS' => l10n('user_status_'.
- $local_user['status']).(($local_user['adviser'] == 'true')
- ? '<br>['.l10n('Adviser').']' : ''),
+ 'STATUS' => l10n('user_status_'.$local_user['status']),
'EMAIL' => get_email_address_as_display_text($local_user['email']),
'GROUPS' => $groups_string,
'PROPERTIES' => implode( ', ', $properties),
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index b720a1eaf..5443781a7 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -304,7 +304,6 @@ from
where
I.user_id = U.'.$conf['user_fields']['id'].' and
I.status in (\'webmaster\', \'admin\') and
- I.adviser = \'false\' and
'.$conf['user_fields']['email'].' is not null and
I.user_id <> '.$user['id'].'
order by
diff --git a/install/db/91-database.php b/install/db/91-database.php
index 871db559e..1f551c517 100644
--- a/install/db/91-database.php
+++ b/install/db/91-database.php
@@ -32,7 +32,7 @@ $upgrade_description = 'Remove adviser status.';
$query = "
UPDATE ".USER_INFOS_TABLE."
SET status = 'normal'
-WHERE (status = 'webmaster' OR status = 'admin')
+WHERE status IN ('webmaster', 'admin')
AND adviser = 'true'
;";
diff --git a/install/piwigo_structure-mysql.sql b/install/piwigo_structure-mysql.sql
index e9f0eb0dc..44124f072 100644
--- a/install/piwigo_structure-mysql.sql
+++ b/install/piwigo_structure-mysql.sql
@@ -404,7 +404,6 @@ CREATE TABLE `piwigo_user_infos` (
`nb_image_line` tinyint(1) unsigned NOT NULL default '5',
`nb_line_page` tinyint(3) unsigned NOT NULL default '3',
`status` enum('webmaster','admin','normal','generic','guest') NOT NULL default 'guest',
- `adviser` enum('true','false') NOT NULL default 'false',
`language` varchar(50) NOT NULL default 'en_UK',
`maxwidth` smallint(6) default NULL,
`maxheight` smallint(6) default NULL,
diff --git a/install/piwigo_structure-pdo-sqlite.sql b/install/piwigo_structure-pdo-sqlite.sql
index ac90d3e9f..e4aa71ca3 100644
--- a/install/piwigo_structure-pdo-sqlite.sql
+++ b/install/piwigo_structure-pdo-sqlite.sql
@@ -467,7 +467,6 @@ CREATE TABLE piwigo_user_infos
"nb_image_line" INTEGER default 5 NOT NULL,
"nb_line_page" INTEGER default 3 NOT NULL,
"status" VARCHAR(50) default 'guest',
- "adviser" BOOLEAN default false,
"language" VARCHAR(50) default 'en_UK' NOT NULL,
"maxwidth" INTEGER,
"maxheight" INTEGER,
diff --git a/install/piwigo_structure-pgsql.sql b/install/piwigo_structure-pgsql.sql
index 719497ba7..f4679cc83 100644
--- a/install/piwigo_structure-pgsql.sql
+++ b/install/piwigo_structure-pgsql.sql
@@ -568,7 +568,6 @@ CREATE TABLE "piwigo_user_infos"
"nb_image_line" INTEGER default 5 NOT NULL,
"nb_line_page" INTEGER default 3 NOT NULL,
"status" USER_INFOS_STATUS default 'guest'::USER_INFOS_STATUS,
- "adviser" BOOLEAN default false,
"language" VARCHAR(50) default 'en_UK' NOT NULL,
"maxwidth" INTEGER,
"maxheight" INTEGER,
diff --git a/install/piwigo_structure-sqlite.sql b/install/piwigo_structure-sqlite.sql
index ac90d3e9f..e4aa71ca3 100644
--- a/install/piwigo_structure-sqlite.sql
+++ b/install/piwigo_structure-sqlite.sql
@@ -467,7 +467,6 @@ CREATE TABLE piwigo_user_infos
"nb_image_line" INTEGER default 5 NOT NULL,
"nb_line_page" INTEGER default 3 NOT NULL,
"status" VARCHAR(50) default 'guest',
- "adviser" BOOLEAN default false,
"language" VARCHAR(50) default 'en_UK' NOT NULL,
"maxwidth" INTEGER,
"maxheight" INTEGER,
diff --git a/password.php b/password.php
index ff08855b0..866021b20 100644
--- a/password.php
+++ b/password.php
@@ -65,12 +65,8 @@ SELECT '.$conf['user_fields']['id'].' AS id
FROM '.USERS_TABLE.' as u
INNER JOIN '.USER_INFOS_TABLE.' AS ui
ON u.'.$conf['user_fields']['id'].' = ui.user_id
-WHERE '
- .$conf['user_fields']['email'].' = \''.$mail_address.'\' AND
- (
- ui.status = \'normal\' OR
- (ui.status in (\'admin\', \'webmaster\') AND ui.adviser = \'true\')
- )
+WHERE '.$conf['user_fields']['email'].' = \''.$mail_address.'\'
+ AND ui.status = \'normal\'
;';
$result = pwg_query($query);
diff --git a/themes/default/theme.css b/themes/default/theme.css
index 10d3834a1..9b0519c46 100644
--- a/themes/default/theme.css
+++ b/themes/default/theme.css
@@ -775,7 +775,7 @@ INPUT.radio, INPUT.checkbox {
padding: 10px 50px 10px 10px;
}
-/* Header message like upgrade or adviser mode */
+/* Header message like upgrade*/
.header_msgs {
text-align:center;
font-weight: bold;