aboutsummaryrefslogtreecommitdiffstats
path: root/admin/site_manager.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-03-06 20:27:41 +0000
committerrvelices <rv-github@modusoptimus.com>2012-03-06 20:27:41 +0000
commit8495df013d3e513345dc921a7f7904503a8a4ac5 (patch)
treee5c6af743a7daabba7cb641093c45f9c30f81f60 /admin/site_manager.php
parent6118d0b1f7bb0588c3d004897fced268afd2e97a (diff)
remove remote sites feature
git-svn-id: http://piwigo.org/svn/trunk@13488 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/site_manager.php150
1 files changed, 9 insertions, 141 deletions
diff --git a/admin/site_manager.php b/admin/site_manager.php
index 8b2134b04..e4b318959 100644
--- a/admin/site_manager.php
+++ b/admin/site_manager.php
@@ -38,43 +38,6 @@ if (!empty($_POST) or isset($_GET['action']))
check_pwg_token();
}
-/**
- * requests the given $url (a remote create_listing_file.php) and fills a
- * list of lines corresponding to request output
- *
- * @param string $url
- * @return void
- */
-function remote_output($url)
-{
- global $template, $page;
-
- if (fetchRemote($url, $result))
- {
- $lines = explode("\r\n", $result);
- // cleaning lines from HTML tags
- foreach ($lines as $line)
- {
- $line = trim(strip_tags($line));
- if (preg_match('/^PWG-([A-Z]+)-/', $line, $matches))
- {
- $template->append(
- 'remote_output',
- array(
- 'CLASS' => 'remote'.ucfirst(strtolower($matches[1])),
- 'CONTENT' => $line
- )
- );
- }
- }
- }
- else
- {
- array_push($page['errors'], l10n('file create_listing_file.php on remote site was not found'));
- }
-}
-
-
// +-----------------------------------------------------------------------+
// | template init |
// +-----------------------------------------------------------------------+
@@ -86,14 +49,15 @@ $template->set_filenames(array('site_manager'=>'site_manager.tpl'));
if (isset($_POST['submit']) and !empty($_POST['galleries_url']))
{
$is_remote = url_is_remote( $_POST['galleries_url'] );
+ if ($is_remote)
+ {
+ fatal_error('remote sites not supported');
+ }
$url = preg_replace('/[\/]*$/', '', $_POST['galleries_url']);
$url.= '/';
- if (! $is_remote)
+ if ( ! (strpos($url, '.') === 0 ) )
{
- if ( ! (strpos($url, '.') === 0 ) )
- {
- $url = './' . $url;
- }
+ $url = './' . $url;
}
// site must not exists
@@ -110,38 +74,10 @@ SELECT COUNT(id) AS count
}
if (count($page['errors']) == 0)
{
- if ($is_remote)
+ if ( ! file_exists($url) )
{
- if ( ! isset($_POST['no_check']) )
- {
- $clf_url = $url.'create_listing_file.php';
- $get_data = array(
- 'action' => 'test',
- 'version' => PHPWG_VERSION,
- );
- if (fetchRemote($clf_url, $result, $get_data))
- {
- $lines = explode("\r\n", $result);
- $first_line = strip_tags($lines[0]);
- if (!preg_match('/^PWG-INFO-2:/', $first_line))
- {
- array_push($page['errors'],
- l10n('an error happened').' : '.$first_line);
- }
- }
- else
- {
- array_push($page['errors'], l10n('file create_listing_file.php on remote site was not found') );
- }
- }
- }
- else
- { // local directory
- if ( ! file_exists($url) )
- {
- array_push($page['errors'],
- l10n('Directory does not exist').' ['.$url.']');
- }
+ array_push($page['errors'],
+ l10n('Directory does not exist').' ['.$url.']');
}
}
@@ -176,24 +112,6 @@ SELECT galleries_url
list($galleries_url) = pwg_db_fetch_row(pwg_query($query));
switch($_GET['action'])
{
- case 'generate' :
- {
- $title = $galleries_url.' : '.l10n('generate listing');
- remote_output($galleries_url.'create_listing_file.php?action=generate');
- break;
- }
- case 'test' :
- {
- $title = $galleries_url.' : '.l10n('test');
- remote_output($galleries_url.'create_listing_file.php?action=test&version='.PHPWG_VERSION);
- break;
- }
- case 'clean' :
- {
- $title = $galleries_url.' : '.l10n('clean');
- remote_output($galleries_url.'create_listing_file.php?action=clean');
- break;
- }
case 'delete' :
{
delete_site($page['site']);
@@ -212,23 +130,6 @@ $template->assign(
)
);
-// +-----------------------------------------------------------------------+
-// | remote sites list |
-// +-----------------------------------------------------------------------+
-
-if ( is_file(PHPWG_ROOT_PATH.'listing.xml') )
-{
- $xml_content = getXmlCode(PHPWG_ROOT_PATH.'listing.xml');
- $local_listing_site_url = getAttribute(
- getChild($xml_content, 'informations'),
- 'url'
- );
- if ( !url_is_remote($local_listing_site_url) )
- {
- $local_listing_site_url = null;
- }
-}
-
$query = '
SELECT c.site_id, COUNT(DISTINCT c.id) AS nb_categories, COUNT(i.id) AS nb_images
FROM '.CATEGORIES_TABLE.' AS c LEFT JOIN '.IMAGES_TABLE.' AS i
@@ -266,16 +167,6 @@ while ($row = pwg_db_fetch_assoc($result))
'U_SYNCHRONIZE' => $update_url
);
- if ($is_remote)
- {
- $tpl_var['remote'] =
- array(
- 'U_TEST' => $base_url.'test',
- 'U_GENERATE' => $row['galleries_url'].'create_listing_file.php?action=generate',
- 'U_CLEAN' => $base_url.'clean',
- );
- }
-
if ($row['id'] != 1)
{
$tpl_var['U_DELETE'] = $base_url.'delete';
@@ -289,30 +180,7 @@ while ($row = pwg_db_fetch_assoc($result))
$tpl_var['plugin_links'] = $plugin_links;
$template->append('sites', $tpl_var);
-
- if ( isset($local_listing_site_url) and
- $row['galleries_url']==$local_listing_site_url )
- {
- $local_listing_site_id = $row['id'];
- $template->assign( 'local_listing',
- array(
- 'URL' => $local_listing_site_url,
- 'U_SYNCHRONIZE' => $update_url.'&amp;local_listing=1'
- )
- );
- }
}
-if ( isset($local_listing_site_url) and !isset($local_listing_site_id) )
-{
- $template->assign( 'local_listing',
- array(
- 'URL' => $local_listing_site_url,
- 'CREATE' => true
- )
- );
-}
-
-
$template->assign_var_from_handle('ADMIN_CONTENT', 'site_manager');
?>