summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/settag.php12
-rwxr-xr-xscripts/setup_status_network.sh6
2 files changed, 7 insertions, 11 deletions
diff --git a/scripts/settag.php b/scripts/settag.php
index d1b06ff10..ca260f7bf 100644
--- a/scripts/settag.php
+++ b/scripts/settag.php
@@ -39,11 +39,10 @@ if (count($args) < 1) {
}
$nickname = $args[0];
-
$sn = Status_network::memGet('nickname', $nickname);
if (empty($sn)) {
- print "No such site.\n";
+ print "No such site ($nickname).\n";
exit(-1);
}
@@ -54,16 +53,13 @@ if (count($args) == 1) {
exit(0);
}
$tag = $args[1];
-
$i = array_search($tag, $tags);
if ($i !== false) {
if (have_option('d', 'delete')) { // Delete
unset($tags[$i]);
- $orig = clone($sn);
- $sn->tags = implode('|', $tags);
- $result = $sn->update($orig);
+ $result = $sn->setTags($tags);
if (!$result) {
print "Couldn't update.\n";
exit(-1);
@@ -78,9 +74,7 @@ if ($i !== false) {
exit(-1);
} else {
$tags[] = $tag;
- $orig = clone($sn);
- $sn->tags = implode('|', $tags);
- $result = $sn->update($orig);
+ $result = $sn->setTags($tags);
if (!$result) {
print "Couldn't update.\n";
exit(-1);
diff --git a/scripts/setup_status_network.sh b/scripts/setup_status_network.sh
index 4ebb696c7..3dd739030 100755
--- a/scripts/setup_status_network.sh
+++ b/scripts/setup_status_network.sh
@@ -44,8 +44,8 @@ mysql -h $DBHOST -u $ADMIN --password=$ADMINPASS $SITEDB << ENDOFCOMMANDS
GRANT ALL ON $database.* TO '$username'@'localhost' IDENTIFIED BY '$password';
GRANT ALL ON $database.* TO '$username'@'%' IDENTIFIED BY '$password';
-INSERT INTO status_network (nickname, dbhost, dbuser, dbpass, dbname, sitename, created, tags)
-VALUES ('$nickname', '$DBHOSTNAME', '$username', '$password', '$database', '$sitename', now(), '$tags');
+INSERT INTO status_network (nickname, dbhost, dbuser, dbpass, dbname, sitename, created)
+VALUES ('$nickname', '$DBHOSTNAME', '$username', '$password', '$database', '$sitename', now());
ENDOFCOMMANDS
@@ -56,6 +56,8 @@ done
php $PHPBASE/scripts/checkschema.php -s"$server"
+php $PHPBASE/scripts/settag.php -s"$server" "$nickname" "$tags"
+
php $PHPBASE/scripts/registeruser.php \
-s"$server" \
-n"$nickname" \