use \Friendica\Core\Config;
function directory_run(&$argv, &$argc){
- if ($argc != 2) {
- return;
- }
-
$dir = get_config('system', 'directory');
if (!strlen($dir)) {
return;
}
+ if ($argc < 2) {
+ directory_update_all();
+ return;
+ }
+
$dir .= "/submit";
$arr = array('url' => $argv[1]);
}
return;
}
+
+function directory_update_all() {
+ $r = q("SELECT `url` FROM `contact`
+ INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
+ INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
+ WHERE `contact`.`self` AND `profile`.`net-publish` AND `profile`.`is-default` AND
+ NOT `user`.`account_expired` AND `user`.`verified`");
+
+ if (dbm::is_result($r)) {
+ foreach ($r AS $user) {
+ proc_run(PRIORITY_LOW, 'include/directory.php', $user['url']);
+ }
+ }
+}
$worker_fastlane = ((x($_POST,'worker_fastlane')) ? True : False);
$worker_frontend = ((x($_POST,'worker_frontend')) ? True : False);
+ // Has the directory url changed? If yes, then resubmit the existing profiles there
+ if ($global_directory != Config::get('system', 'directory') AND ($global_directory != '')) {
+ Config::set('system', 'directory', $global_directory);
+ proc_run(PRIORITY_LOW, 'include/directory.php');
+ }
+
if ($a->get_path() != "") {
$diaspora_enabled = false;
}
set_config('system', 'allowed_email', $allowed_email);
set_config('system', 'block_public', $block_public);
set_config('system', 'publish_all', $force_publish);
- set_config('system', 'directory', $global_directory);
set_config('system', 'thread_allow', $thread_allow);
set_config('system', 'newuser_private', $newuser_private);
set_config('system', 'enotify_no_content', $enotify_no_content);