is_file("addon/".$a->argv[2]."/".$a->argv[2].".php")){
@include_once("addon/".$a->argv[2]."/".$a->argv[2].".php");
if(function_exists($a->argv[2].'_plugin_admin_post')) {
is_file("addon/".$a->argv[2]."/".$a->argv[2].".php")){
@include_once("addon/".$a->argv[2]."/".$a->argv[2].".php");
if(function_exists($a->argv[2].'_plugin_admin_post')) {
$t = get_markup_template("admin_aside.tpl");
$a->page['aside'] .= replace_macros( $t, array(
$t = get_markup_template("admin_aside.tpl");
$a->page['aside'] .= replace_macros( $t, array(
if (x($_POST,'relocate') && x($_POST,'relocate_url') && $_POST['relocate_url']!=""){
$new_url = $_POST['relocate_url'];
$new_url = rtrim($new_url,"/");
if (x($_POST,'relocate') && x($_POST,'relocate_url') && $_POST['relocate_url']!=""){
$new_url = $_POST['relocate_url'];
$new_url = rtrim($new_url,"/");
$parsed = @parse_url($new_url);
if (!$parsed || (!x($parsed,'host') || !x($parsed,'scheme'))) {
notice(t("Can not parse base url. Must have at least <scheme>://<domain>"));
goaway($a->get_baseurl(true) . '/admin/site' );
}
$parsed = @parse_url($new_url);
if (!$parsed || (!x($parsed,'host') || !x($parsed,'scheme'))) {
notice(t("Can not parse base url. Must have at least <scheme>://<domain>"));
goaway($a->get_baseurl(true) . '/admin/site' );
}
/* steps:
* replace all "baseurl" to "new_url" in config, profile, term, items and contacts
* send relocate for every local user
* */
/* steps:
* replace all "baseurl" to "new_url" in config, profile, term, items and contacts
* send relocate for every local user
* */
function update_table($table_name, $fields, $old_url, $new_url) {
global $db, $a;
function update_table($table_name, $fields, $old_url, $new_url) {
global $db, $a;
$upd = array();
foreach ($fields as $f) {
$upd[] = "`$f` = REPLACE(`$f`, '$dbold', '$dbnew')";
}
$upd = array();
foreach ($fields as $f) {
$upd[] = "`$f` = REPLACE(`$f`, '$dbold', '$dbnew')";
}
// update tables
update_table("profile", array('photo', 'thumb'), $old_url, $new_url);
update_table("term", array('url'), $old_url, $new_url);
update_table("contact", array('photo','thumb','micro','url','nurl','request','notify','poll','confirm','poco'), $old_url, $new_url);
// update tables
update_table("profile", array('photo', 'thumb'), $old_url, $new_url);
update_table("term", array('url'), $old_url, $new_url);
update_table("contact", array('photo','thumb','micro','url','nurl','request','notify','poll','confirm','poco'), $old_url, $new_url);
update_table("item", array('owner-link','owner-avatar','author-name','author-link','author-avatar','body','plink','tag'), $old_url, $new_url);
// update config
$a->set_baseurl($new_url);
set_config('system','url',$new_url);
update_table("item", array('owner-link','owner-avatar','author-name','author-link','author-avatar','body','plink','tag'), $old_url, $new_url);
// update config
$a->set_baseurl($new_url);
set_config('system','url',$new_url);
foreach ($users as $user) {
proc_run('php', 'include/notifier.php', 'relocate', $user['uid']);
}
info("Relocation started. Could take a while to complete.");
foreach ($users as $user) {
proc_run('php', 'include/notifier.php', 'relocate', $user['uid']);
}
info("Relocation started. Could take a while to complete.");
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
$info = ((x($_POST,'info')) ? trim($_POST['info']) : false);
$sitename = ((x($_POST,'sitename')) ? notags(trim($_POST['sitename'])) : '');
$banner = ((x($_POST,'banner')) ? trim($_POST['banner']) : false);
$info = ((x($_POST,'info')) ? trim($_POST['info']) : false);
$temppath = ((x($_POST,'temppath')) ? notags(trim($_POST['temppath'])) : '');
$basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : '');
$singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : '');
$temppath = ((x($_POST,'temppath')) ? notags(trim($_POST['temppath'])) : '');
$basepath = ((x($_POST,'basepath')) ? notags(trim($_POST['basepath'])) : '');
$singleuser = ((x($_POST,'singleuser')) ? notags(trim($_POST['singleuser'])) : '');
if($ssl_policy != intval(get_config('system','ssl_policy'))) {
if($ssl_policy == SSL_POLICY_FULL) {
q("update `contact` set
if($ssl_policy != intval(get_config('system','ssl_policy'))) {
if($ssl_policy == SSL_POLICY_FULL) {
q("update `contact` set
`photo` = replace(`photo` , 'http:' , 'https:'),
`thumb` = replace(`thumb` , 'http:' , 'https:')
where 1 "
);
}
elseif($ssl_policy == SSL_POLICY_SELFSIGN) {
`photo` = replace(`photo` , 'http:' , 'https:'),
`thumb` = replace(`thumb` , 'http:' , 'https:')
where 1 "
);
}
elseif($ssl_policy == SSL_POLICY_SELFSIGN) {
`url` = replace(`url` , 'https:' , 'http:'),
`photo` = replace(`photo` , 'https:' , 'http:'),
`thumb` = replace(`thumb` , 'https:' , 'http:'),
`url` = replace(`url` , 'https:' , 'http:'),
`photo` = replace(`photo` , 'https:' , 'http:'),
`thumb` = replace(`thumb` , 'https:' , 'http:'),
`photo` = replace(`photo` , 'https:' , 'http:'),
`thumb` = replace(`thumb` , 'https:' , 'http:')
where 1 "
`photo` = replace(`photo` , 'https:' , 'http:'),
`thumb` = replace(`thumb` , 'https:' , 'http:')
where 1 "
set_config('system','lockpath', $lockpath);
set_config('system','temppath', $temppath);
set_config('system','basepath', $basepath);
set_config('system','lockpath', $lockpath);
set_config('system','temppath', $temppath);
set_config('system','basepath', $basepath);
$banner = '<a href="http://friendica.com"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="http://friendica.com">Friendica</a></span>';
$banner = htmlspecialchars($banner);
$info = get_config('config','info');
$info = htmlspecialchars($info);
$banner = '<a href="http://friendica.com"><img id="logo-img" src="images/friendica-32.png" alt="logo" /></a><span id="logo-text"><a href="http://friendica.com">Friendica</a></span>';
$banner = htmlspecialchars($banner);
$info = get_config('config','info');
$info = htmlspecialchars($info);
REGISTER_CLOSED => t("Closed"),
REGISTER_APPROVE => t("Requires approval"),
REGISTER_OPEN => t("Open")
REGISTER_CLOSED => t("Closed"),
REGISTER_APPROVE => t("Requires approval"),
REGISTER_OPEN => t("Open")
'$use_fulltext_engine' => array('use_fulltext_engine', t("Use MySQL full text engine"), get_config('system','use_fulltext_engine'), t("Activates the full text engine. Speeds up search - but can only search for four and more characters.")),
'$suppress_language' => array('suppress_language', t("Suppress Language"), get_config('system','suppress_language'), t("Suppress language information in meta information about a posting.")),
'$itemcache' => array('itemcache', t("Path to item cache"), get_config('system','itemcache'), "The item caches buffers generated bbcode and external images."),
'$use_fulltext_engine' => array('use_fulltext_engine', t("Use MySQL full text engine"), get_config('system','use_fulltext_engine'), t("Activates the full text engine. Speeds up search - but can only search for four and more characters.")),
'$suppress_language' => array('suppress_language', t("Suppress Language"), get_config('system','suppress_language'), t("Suppress language information in meta information about a posting.")),
'$itemcache' => array('itemcache', t("Path to item cache"), get_config('system','itemcache'), "The item caches buffers generated bbcode and external images."),
- '$itemcache_duration' => array('itemcache_duration', t("Cache duration in seconds"), get_config('system','itemcache_duration'), t("How long should the cache files be hold? Default value is 86400 seconds (One day).")),
+ '$itemcache_duration' => array('itemcache_duration', t("Cache duration in seconds"), get_config('system','itemcache_duration'), t("How long should the cache files be hold? Default value is 86400 seconds (One day). To disable the item cache, set the value to -1.")),
'$max_comments' => array('max_comments', t("Maximum numbers of comments per post"), get_config('system','max_comments'), t("How much comments should be shown for each post? Default value is 100.")),
'$lockpath' => array('lockpath', t("Path for lock file"), get_config('system','lockpath'), "The lock file is used to avoid multiple pollers at one time. Only define a folder here."),
'$temppath' => array('temppath', t("Temp path"), get_config('system','temppath'), "If you have a restricted system where the webserver can't access the system temp path, enter another path here."),
'$basepath' => array('basepath', t("Base path to installation"), get_config('system','basepath'), "If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
'$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."),
'$max_comments' => array('max_comments', t("Maximum numbers of comments per post"), get_config('system','max_comments'), t("How much comments should be shown for each post? Default value is 100.")),
'$lockpath' => array('lockpath', t("Path for lock file"), get_config('system','lockpath'), "The lock file is used to avoid multiple pollers at one time. Only define a folder here."),
'$temppath' => array('temppath', t("Temp path"), get_config('system','temppath'), "If you have a restricted system where the webserver can't access the system temp path, enter another path here."),
'$basepath' => array('basepath', t("Base path to installation"), get_config('system','basepath'), "If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
'$relocate_url' => array('relocate_url', t("New base url"), $a->get_baseurl(), "Change base url for this server. Sends relocate message to all DFRN contacts of all users."),
-
- '$form_security_token' => get_form_security_token("admin_site"),
+
+ '$enable_noscrape'=> array('enable_noscrape', t("Enable noscrape"), get_config('system','enable_noscrape'), t("The noscrape feature speeds up directory submissions by using JSON data instead of HTML scraping.")),
+ '$form_security_token' => get_form_security_token("admin_site")
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.', $func));
}
elseif($retval === UPDATE_SUCCESS) {
$o .= sprintf( t('Update %s was successfully applied.', $func));
'$delete' => t('Delete'),
'$block' => t('Block'),
'$unblock' => t('Unblock'),
'$delete' => t('Delete'),
'$block' => t('Block'),
'$unblock' => t('Unblock'),
- '$siteadmin' => t('Site admin'),
- '$accountexpired' => t('Account expired'),
-
+ '$siteadmin' => t('Site admin'),
+ '$accountexpired' => t('Account expired'),
+
'$h_users' => t('Users'),
'$h_newuser' => t('New User'),
'$th_deleted' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Deleted since') ),
'$h_users' => t('Users'),
'$h_newuser' => t('New User'),
'$th_deleted' => array( t('Name'), t('Email'), t('Register date'), t('Last login'), t('Last item'), t('Deleted since') ),
'$confirm_delete_multi' => t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete_multi' => t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
- '$newusername' => array('new_user_name', t("Name"), '', t("Name of the new user.")),
- '$newusernickname' => array('new_user_nickname', t("Nickname"), '', t("Nickname of the new user.")),
- '$newuseremail' => array('new_user_email', t("Email"), '', t("Email address of the new user.")),
+ '$newusername' => array('new_user_name', t("Name"), '', t("Name of the new user.")),
+ '$newusernickname' => array('new_user_nickname', t("Nickname"), '', t("Nickname of the new user.")),
+ '$newuseremail' => array('new_user_email', t("Email"), '', t("Email address of the new user.")),
function admin_page_logs_post(&$a) {
if (x($_POST,"page_logs")) {
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');
function admin_page_logs_post(&$a) {
if (x($_POST,"page_logs")) {
check_form_security_token_redirectOnErr('/admin/logs', 'admin_logs');