aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/add_index/admin/main_page.php60
-rw-r--r--plugins/c13y_upgrade/initialize.inc.php188
-rw-r--r--plugins/c13y_upgrade/main.inc.php48
3 files changed, 148 insertions, 148 deletions
diff --git a/plugins/add_index/admin/main_page.php b/plugins/add_index/admin/main_page.php
index 78dd89602..06e1cf61d 100644
--- a/plugins/add_index/admin/main_page.php
+++ b/plugins/add_index/admin/main_page.php
@@ -20,15 +20,15 @@
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
-
-if ((!defined('PHPWG_ROOT_PATH')) or (!(defined('IN_ADMIN') and IN_ADMIN)))
-{
- die('Hacking attempt!');
-}
-
-// +-----------------------------------------------------------------------+
-// | include |
-// +-----------------------------------------------------------------------+
+
+if ((!defined('PHPWG_ROOT_PATH')) or (!(defined('IN_ADMIN') and IN_ADMIN)))
+{
+ die('Hacking attempt!');
+}
+
+// +-----------------------------------------------------------------------+
+// | include |
+// +-----------------------------------------------------------------------+
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
@@ -82,15 +82,15 @@ function get_add_index_directories($path, $recursive = true)
// +-----------------------------------------------------------------------+
// | Main |
-// +-----------------------------------------------------------------------+
-// Compute values
+// +-----------------------------------------------------------------------+
+// Compute values
$index_file_src=$conf['add_index_source_directory_path'].$conf['add_index_filename'];
$overwrite_file=isset($_GET['overwrite']);
$site_id = (isset($_GET['site_id']) and is_numeric($_GET['site_id'])
? $_GET['site_id']
: 0);
-
-// Init values
+
+// Init values
$add_index_results = array();
$count_copy = 0;
$count_skip = 0;
@@ -145,9 +145,9 @@ order by
$count_skip++;
}
}
- }
- else
- {
+ }
+ else
+ {
if (!empty($site_id))
{
array_push($page['errors'],
@@ -183,20 +183,20 @@ else
array_push($page['errors'],
sprintf(l10n('add_index_src_file_dont_exists'), $index_file_src));
}
-
-// +-----------------------------------------------------------------------+
-// | template initialization |
-// +-----------------------------------------------------------------------+
-$template->set_filenames(array('main_page' => dirname(__FILE__).'/main_page.tpl'));
-
-if (count($add_index_results) != 0)
-{
+
+// +-----------------------------------------------------------------------+
+// | template initialization |
+// +-----------------------------------------------------------------------+
+$template->set_filenames(array('main_page' => dirname(__FILE__).'/main_page.tpl'));
+
+if (count($add_index_results) != 0)
+{
$template->assign('add_index_results', $add_index_results);
-}
-
-// +-----------------------------------------------------------------------+
-// | Sending html code |
-// +-----------------------------------------------------------------------+
-$template->assign_var_from_handle( 'ADMIN_CONTENT', 'main_page');
+}
+
+// +-----------------------------------------------------------------------+
+// | Sending html code |
+// +-----------------------------------------------------------------------+
+$template->assign_var_from_handle( 'ADMIN_CONTENT', 'main_page');
?> \ No newline at end of file
diff --git a/plugins/c13y_upgrade/initialize.inc.php b/plugins/c13y_upgrade/initialize.inc.php
index 109d41e96..38a007e5f 100644
--- a/plugins/c13y_upgrade/initialize.inc.php
+++ b/plugins/c13y_upgrade/initialize.inc.php
@@ -20,97 +20,97 @@
// | 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__).'/');
-
- $to_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)))
- {
- $to_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))
- {
- $to_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 be deactivate */
- if ($to_deactivate)
- {
- $query = '
-REPLACE INTO '.PLUGINS_TABLE.'
-(id, state)
-VALUES (\'c13y_upgrade\', \'inactive\')
-;';
- pwg_query($query);
-
- global $page;
- $page['infos'][] = l10n('c13y_upgrade_no_anomaly');
- }
-}
-
-?>
+
+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__).'/');
+
+ $to_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)))
+ {
+ $to_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))
+ {
+ $to_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 be deactivate */
+ if ($to_deactivate)
+ {
+ $query = '
+REPLACE INTO '.PLUGINS_TABLE.'
+(id, state)
+VALUES (\'c13y_upgrade\', \'inactive\')
+;';
+ pwg_query($query);
+
+ global $page;
+ $page['infos'][] = l10n('c13y_upgrade_no_anomaly');
+ }
+}
+
+?>
diff --git a/plugins/c13y_upgrade/main.inc.php b/plugins/c13y_upgrade/main.inc.php
index 46f72b8fe..c4d6b8705 100644
--- a/plugins/c13y_upgrade/main.inc.php
+++ b/plugins/c13y_upgrade/main.inc.php
@@ -19,28 +19,28 @@
// | 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: 2.0
+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');
+ }
+}
-/*
-Plugin Name: Check upgrades
-Version: 2.0
-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');
- }
-}
-
-?>
+?>