Skip to content
Snippets Groups Projects
Commit ed181ab0 authored by ale's avatar ale
Browse files

Remove obsolete update-friend-domains command

parent 9c186279
No related branches found
No related tags found
No related merge requests found
...@@ -12,9 +12,6 @@ Known commands: ...@@ -12,9 +12,6 @@ Known commands:
info BLOG [...] info BLOG [...]
Print some basic information about one or more blogs. Print some basic information about one or more blogs.
connectdb BLOG
Connect to the MySQL instance that has the blog db.
get-option OPTION_NAME BLOG [...] get-option OPTION_NAME BLOG [...]
Print the value of an option for the specified blogs. Print the value of an option for the specified blogs.
...@@ -57,9 +54,6 @@ Known commands: ...@@ -57,9 +54,6 @@ Known commands:
Remove the 'network upgrade' message when all the blogs have Remove the 'network upgrade' message when all the blogs have
been upgraded individually. been upgraded individually.
update-friend-domains
Update the list of 'friend' email domains.
check-updates check-updates
Check for updates of core, plugins and themes. Check for updates of core, plugins and themes.
Options: Options:
...@@ -123,22 +117,6 @@ function do_info($args) { ...@@ -123,22 +117,6 @@ function do_info($args) {
} }
} }
// 'connectdb': Connect to the database hosting a specific blog.
function do_connectdb($args) {
$blog = noblogs_get_blog($args[0]);
if (!$blog) {
die("Blog not found.\n");
}
$backend = noblogs_get_backend_for_blog($blog->blog_id);
echo "ID: {$blog->blog_id}\n";
$cmd = "mysql -A -h {$backend['host']} -P {$backend['port']} -u{$backend['user']} -p{$backend['password']} {$backend['db']}";
echo "$cmd\n";
//system($cmd);
}
// 'get-option': Print the value of a blog option. // 'get-option': Print the value of a blog option.
function do_get_option($args) { function do_get_option($args) {
$option = $args[0]; $option = $args[0];
...@@ -327,12 +305,6 @@ function do_fix_rewrites($args) { ...@@ -327,12 +305,6 @@ function do_fix_rewrites($args) {
} }
} }
function do_update_friend_domains($args) {
$domains = noblogs_list_friend_domains();
update_site_option('limited_email_domains', $domains);
echo "Update done.\n";
}
function do_check_spam($args) { function do_check_spam($args) {
global $wpdb; global $wpdb;
$spamcount = 0; $spamcount = 0;
...@@ -464,8 +436,8 @@ function do_set_readonly($args) { ...@@ -464,8 +436,8 @@ function do_set_readonly($args) {
function do_ngg_convert($args) { function do_ngg_convert($args) {
require_once(dirname(__FILE__) . '/ngg.php'); require_once(dirname(__FILE__) . '/ngg.php');
foreach ($args as $arg) { foreach ($args as $arg) {
$blog = noblogs_get_blog($arg); $blog = noblogs_get_blog($arg);
if (!$blog) { if (!$blog) {
echo "Blog {$arg} not found.\n"; echo "Blog {$arg} not found.\n";
......
<?php
function _is_domain($x) {
return ($x != "" && $x[0] != "#");
}
function noblogs_list_friend_domains() {
exec("ldapsearch -LLL -u -x '(&(status=active)(acceptMail=true))' cn | awk '/^cn:/ {print $2}'", $ldap_domains);
$ext_domains = explode("\n", file_get_contents("/etc/noblogs/friend_domains"));
$all_domains = array_filter(array_merge($ldap_domains, $ext_domains),
"_is_domain");
sort($all_domains);
return $all_domains;
}
...@@ -8,7 +8,6 @@ define('AI_CRON_SCRIPT', true); ...@@ -8,7 +8,6 @@ define('AI_CRON_SCRIPT', true);
// Load our includes. // Load our includes.
require_once(dirname(__FILE__) . '/blogs.php'); require_once(dirname(__FILE__) . '/blogs.php');
require_once(dirname(__FILE__) . '/cron.php'); require_once(dirname(__FILE__) . '/cron.php');
require_once(dirname(__FILE__) . '/friends.php');
require_once(dirname(__FILE__) . '/editfiles.php'); require_once(dirname(__FILE__) . '/editfiles.php');
require_once(dirname(__FILE__) . '/wp-piwik.php'); require_once(dirname(__FILE__) . '/wp-piwik.php');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment