aboutsummaryrefslogtreecommitdiffstats
path: root/BSF/plugins/c13y_upgrade
diff options
context:
space:
mode:
authorvdigital <vdigital@piwigo.org>2008-05-23 21:05:41 +0000
committervdigital <vdigital@piwigo.org>2008-05-23 21:05:41 +0000
commit77fd1f51a3c5f5a52f72ef8a299fe368228e2285 (patch)
treea67ede42904657ccf3349ecdaef1cec8b8e36ff8 /BSF/plugins/c13y_upgrade
parent553727dffacc48e8337c1d141f2a25af359e74b1 (diff)
git-svn-id: http://piwigo.org/svn/trunk@2357 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'BSF/plugins/c13y_upgrade')
-rw-r--r--BSF/plugins/c13y_upgrade/index.php30
-rw-r--r--BSF/plugins/c13y_upgrade/initialize.inc.php142
-rw-r--r--BSF/plugins/c13y_upgrade/language/en_UK/index.php30
-rw-r--r--BSF/plugins/c13y_upgrade/language/en_UK/plugin.lang.php32
-rw-r--r--BSF/plugins/c13y_upgrade/language/es_ES/index.php30
-rw-r--r--BSF/plugins/c13y_upgrade/language/es_ES/plugin.lang.php32
-rw-r--r--BSF/plugins/c13y_upgrade/language/fr_FR/index.php30
-rw-r--r--BSF/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php32
-rw-r--r--BSF/plugins/c13y_upgrade/language/index.php30
-rw-r--r--BSF/plugins/c13y_upgrade/main.inc.php46
10 files changed, 434 insertions, 0 deletions
diff --git a/BSF/plugins/c13y_upgrade/index.php b/BSF/plugins/c13y_upgrade/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/c13y_upgrade/initialize.inc.php b/BSF/plugins/c13y_upgrade/initialize.inc.php
new file mode 100644
index 000000000..cd7034c4c
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/initialize.inc.php
@@ -0,0 +1,142 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+add_event_handler('list_check_integrity', 'c13y_upgrade');
+
+function c13y_upgrade($c13y)
+{
+ global $conf;
+
+ load_language('plugin.lang', dirname(__FILE__).'/');
+
+ $can_be_deactivate = true;
+
+ /* Check user with same e-mail */
+ $query = '
+select
+ count(*)
+from
+ '.USERS_TABLE.'
+where
+ '.$conf['user_fields']['email'].' is not null
+group by
+ upper('.$conf['user_fields']['email'].')
+having count(*) > 1
+limit 0,1
+;';
+
+ if (mysql_fetch_array(pwg_query($query)))
+ {
+ $can_be_deactivate = false;
+ $c13y->add_anomaly(
+ l10n('c13y_dbl_email_user'),
+ null,
+ null,
+ l10n('c13y_correction_dbl_email_user'));
+ }
+
+ /* Check plugin included in Piwigo sources */
+ $included_plugins = array('dew', 'UpToDate', 'PluginsManager');
+ $query = '
+select
+ id
+from
+ '.PLUGINS_TABLE.'
+where
+ id in ('.
+ implode(
+ ',',
+ array_map(
+ create_function('$s', 'return "\'".$s."\'";'),
+ $included_plugins
+ )
+ )
+ .')
+;';
+
+ $result = pwg_query($query);
+ while ($row = mysql_fetch_assoc($result))
+ {
+ $can_be_deactivate = false;
+
+ $uninstall_msg_link =
+ '<a href="'.
+ PHPWG_ROOT_PATH.
+ 'admin.php?page=plugins_list&amp;plugin='.$row['id'].'&amp;action=uninstall'.
+ '" onclick="window.open(this.href, \'\'); return false;">'.
+ sprintf(l10n('c13y_correction_obsolete_plugin'), $row['id']).'</a>';
+
+ $c13y->add_anomaly(
+ l10n('c13y_obsolete_plugin'),
+ null,
+ null,
+ $uninstall_msg_link);
+ }
+
+ /* Check if this plugin must deactivate */
+ if ($can_be_deactivate)
+ {
+ $deactivate_msg_link =
+ '<a href="'.
+ PHPWG_ROOT_PATH.
+ 'admin.php?page=plugins_list&amp;plugin=c13y_upgrade&amp;action=deactivate'.
+ '" onclick="window.open(this.href, \'\'); return false;">'.
+ l10n('c13y_upgrade_deactivate').'</a>';
+
+ $c13y->add_anomaly(
+ l10n('c13y_upgrade_no_anomaly'),
+ 'c13y_upgrade_correction',
+ 'deactivate_plugin',
+ $deactivate_msg_link
+ );
+ }
+}
+
+function c13y_upgrade_correction($action)
+{
+ $result = false;
+
+ switch ($action)
+ {
+ case 'deactivate_plugin':
+ {
+ $query = '
+REPLACE INTO '.PLUGINS_TABLE.'
+(id, state)
+VALUES (\'c13y_upgrade\', \'inactive\')
+;';
+ pwg_query($query);
+ $result = true;
+ }
+ break;
+ }
+
+ return $result;
+}
+
+?>
diff --git a/BSF/plugins/c13y_upgrade/language/en_UK/index.php b/BSF/plugins/c13y_upgrade/language/en_UK/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/language/en_UK/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/c13y_upgrade/language/en_UK/plugin.lang.php b/BSF/plugins/c13y_upgrade/language/en_UK/plugin.lang.php
new file mode 100644
index 000000000..b4fd37004
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/language/en_UK/plugin.lang.php
@@ -0,0 +1,32 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// --------- Starting below: New or revised $lang ---- from Butterfly (1.8)
+$lang['c13y_upgrade_no_anomaly'] = 'No anomaly detected after application upgrade';
+$lang['c13y_upgrade_deactivate'] = 'You can deactivate "Check upgrades" plugin';
+$lang['c13y_dbl_email_user'] = 'Users with same email address';
+$lang['c13y_correction_dbl_email_user'] = 'Delete duplicate users';
+$lang['c13y_obsolete_plugin'] = 'Obsolete plugin';
+$lang['c13y_correction_obsolete_plugin'] = '"%s" plugin has been included in this application version and you must uninstall it.';
+
+?>
diff --git a/BSF/plugins/c13y_upgrade/language/es_ES/index.php b/BSF/plugins/c13y_upgrade/language/es_ES/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/language/es_ES/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/c13y_upgrade/language/es_ES/plugin.lang.php b/BSF/plugins/c13y_upgrade/language/es_ES/plugin.lang.php
new file mode 100644
index 000000000..839623f1c
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/language/es_ES/plugin.lang.php
@@ -0,0 +1,32 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// --------- Starting below: New or revised $lang ---- from Butterfly (1.8)
+$lang['c13y_upgrade_no_anomaly'] = 'Ninguna anomalía detectada después de la puesta al día de la aplicación';
+$lang['c13y_upgrade_deactivate'] = 'Usted puede desactivar el plugin Check upgrades';
+$lang['c13y_dbl_email_user'] = 'Utilizadores con la misma dirección e-mail';
+$lang['c13y_correction_dbl_email_user'] = 'Suprima a los utilizadores en duplicado';
+/* TODO */ $lang['c13y_obsolete_plugin'] = 'Obsolete plugin';
+/* TODO */ $lang['c13y_correction_obsolete_plugin'] = '"%s" plugin has been included in this application version and you must uninstall it.';
+
+?>
diff --git a/BSF/plugins/c13y_upgrade/language/fr_FR/index.php b/BSF/plugins/c13y_upgrade/language/fr_FR/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/language/fr_FR/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php b/BSF/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php
new file mode 100644
index 000000000..bd903f213
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/language/fr_FR/plugin.lang.php
@@ -0,0 +1,32 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// --------- Starting below: New or revised $lang ---- from Butterfly (1.8)
+$lang['c13y_upgrade_no_anomaly'] = 'Pas d\'anomalie détectée après la mise à jour de l\'application';
+$lang['c13y_upgrade_deactivate'] = 'Vous pouvez désactiver le plugin "Check upgrades"';
+$lang['c13y_dbl_email_user'] = 'Utilisateurs avec la même adresse email';
+$lang['c13y_correction_dbl_email_user'] = 'Supprimez les utilisateurs en double';
+$lang['c13y_obsolete_plugin'] = 'Plugin obsolète';
+$lang['c13y_correction_obsolete_plugin'] = 'Le plugin "%s" a été inclus dans cette version de l\'application et vous devez le désinstaller.';
+
+?>
diff --git a/BSF/plugins/c13y_upgrade/language/index.php b/BSF/plugins/c13y_upgrade/language/index.php
new file mode 100644
index 000000000..c15b15795
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/language/index.php
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
diff --git a/BSF/plugins/c13y_upgrade/main.inc.php b/BSF/plugins/c13y_upgrade/main.inc.php
new file mode 100644
index 000000000..a6130322e
--- /dev/null
+++ b/BSF/plugins/c13y_upgrade/main.inc.php
@@ -0,0 +1,46 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008 Piwigo Team http://piwigo.org |
+// | Copyright(C) 2003-2008 Piwigo team http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify |
+// | it under the terms of the GNU General Public License as published by |
+// | the Free Software Foundation |
+// | |
+// | This program is distributed in the hope that it will be useful, but |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
+// | General Public License for more details. |
+// | |
+// | You should have received a copy of the GNU General Public License |
+// | along with this program; if not, write to the Free Software |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA. |
+// +-----------------------------------------------------------------------+
+
+/*
+Plugin Name: Check upgrades
+Version: 1.8
+Description: Check integrity of upgrades / Contrôle d'intégrité des mises à jour
+Plugin URI: http://piwigo.org
+Author: Piwigo team
+Author URI: http://piwigo.org
+*/
+
+if (!defined('PHPWG_ROOT_PATH'))
+{
+ die('Hacking attempt!');
+}
+
+if (in_array(script_basename(), array('popuphelp', 'admin')))
+{
+ if (defined('IN_ADMIN') and IN_ADMIN)
+ {
+ include_once(dirname(__FILE__).'/initialize.inc.php');
+ }
+}
+
+?>