From 603f95d17db5f8e65fa23b9c5cf997c3c0ba15ed Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 31 Oct 2009 15:40:26 -0400 Subject: add and update choqok --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 2657763f4..2982bac58 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -7,6 +7,7 @@ VALUES ('anyio', 'Any.IO', 'http://any.io/', now()), ('betwittered','BeTwittered','http://www.32hours.com/betwitteredinfo/', now()), ('bti','bti','http://gregkh.github.com/bti/', now()), + ('choqok', 'Choqok', 'http://choqok.gnufolks.org/', now()), ('cliqset', 'Cliqset', 'http://www.cliqset.com/', now()), ('deskbar','Deskbar-Applet','http://www.gnome.org/projects/deskbar-applet/', now()), ('Do','Gnome Do','http://do.davebsd.com/wiki/index.php?title=Microblog_Plugin', now()), -- cgit v1.2.3-54-g00ecf From 659da177ea017daaab137b7e608c6c0500c6d586 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 31 Oct 2009 15:49:21 -0400 Subject: Add SocialOomph --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 2982bac58..5c5c939dd 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -44,6 +44,7 @@ VALUES ('rygh.no','rygh.no','http://rygh.no/', now()), ('ryghsms','ryghsms','http://sms.rygh.no/', now()), ('smob','SMOB','http://smob.sioc-project.org/', now()), + ('socialoomphBfD4pMqz31', 'SocialOomph', 'http://www.socialoomph.com/', now()), ('spaz','Spaz','http://funkatron.com/spaz', now()), ('tarpipe','tarpipe','http://tarpipe.com/', now()), ('tjunar','Tjunar','http://nederflash.nl/boek/titels/tjunar-air', now()), -- cgit v1.2.3-54-g00ecf From 66645282440d914c899ba63fffd1ee911c0f8879 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 1 Nov 2009 11:09:14 -0500 Subject: Revert "Blacklist all files and directories in the web root (INSTALLDIR). Much more elegant than manually keep tracking of these invalid usernames." This reverts commit 15f9c80c28042a5f9d51ec8444e3c9c475360481. So, so, elegant! And so, so, incorrect! We can't have a user named 'notice' because that would interfere with URLs like /notice/1234. However, there is no file named 'notice' in the Web root. If there were a way to automatically pull out the virtual paths in the root dir, this may make sense. Until then, we keep track here. --- classes/User.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/classes/User.php b/classes/User.php index 007662131..7ab9f307a 100644 --- a/classes/User.php +++ b/classes/User.php @@ -120,15 +120,11 @@ class User extends Memcached_DataObject function allowed_nickname($nickname) { // XXX: should already be validated for size, content, etc. - - $blacklist = array(); - - //all directory and file names should be blacklisted - $d = dir(INSTALLDIR); - while (false !== ($entry = $d->read())) { - $blacklist[]=$entry; - } - $d->close(); + static $blacklist = array('rss', 'xrds', 'doc', 'main', + 'settings', 'notice', 'user', + 'search', 'avatar', 'tag', 'tags', + 'api', 'message', 'group', 'groups', + 'local'); $merged = array_merge($blacklist, common_config('nickname', 'blacklist')); return !in_array($nickname, $merged); } -- cgit v1.2.3-54-g00ecf From eee033ae7c78568129e7c35c9846e2be8800f4c2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 2 Nov 2009 17:28:03 -0500 Subject: script to register a user --- scripts/registeruser.php | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 scripts/registeruser.php diff --git a/scripts/registeruser.php b/scripts/registeruser.php new file mode 100644 index 000000000..9857f5aee --- /dev/null +++ b/scripts/registeruser.php @@ -0,0 +1,81 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'n:w:f:e:'; +$longoptions = array('nickname=', 'password=', 'fullname=', 'email='); + +$helptext = << $nickname, + 'password' => $password, + 'fullname' => $fullname)); + + if (empty($user)) { + throw new Exception("Can't register user '$nickname' with password '$password' and fullname '$fullname'."); + } + + if (!empty($email)) { + + $orig = clone($user); + + $user->email = $email; + + if (!$user->updateKeys($orig)) { + print "Failed!\n"; + throw new Exception("Can't update email address."); + } + } + +} catch (Exception $e) { + print $e->getMessage() . "\n"; + exit(1); +} -- cgit v1.2.3-54-g00ecf From edb2713026933a3de877d7198ee265f1858c2370 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 2 Nov 2009 18:06:09 -0500 Subject: correct name in registeruser --- scripts/registeruser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/registeruser.php b/scripts/registeruser.php index 9857f5aee..5d9c8862d 100644 --- a/scripts/registeruser.php +++ b/scripts/registeruser.php @@ -24,8 +24,8 @@ $shortoptions = 'n:w:f:e:'; $longoptions = array('nickname=', 'password=', 'fullname=', 'email='); $helptext = << Date: Mon, 2 Nov 2009 18:06:27 -0500 Subject: script to make someone a group admin --- scripts/makegroupadmin.php | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 scripts/makegroupadmin.php diff --git a/scripts/makegroupadmin.php b/scripts/makegroupadmin.php new file mode 100644 index 000000000..a68798451 --- /dev/null +++ b/scripts/makegroupadmin.php @@ -0,0 +1,89 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'g:n:'; +$longoptions = array('nickname=', 'group='); + +$helptext = << $group->id, + 'profile_id' => $user->id)); + + if (empty($member)) { + $member = new Group_member(); + + $member->group_id = $group->id; + $member->profile_id = $user->id; + $member->created = common_sql_now(); + + if (!$member->insert()) { + throw new Exception("Can't add '$nickname' to '$groupname'."); + } + } + + if ($member->is_admin) { + throw new Exception("'$nickname' is already an admin of '$groupname'."); + } + + $orig = clone($member); + + $member->is_admin = 1; + + if (!$member->update($orig)) { + throw new Exception("Can't make '$nickname' admin of '$groupname'."); + } + +} catch (Exception $e) { + print $e->getMessage() . "\n"; + exit(1); +} -- cgit v1.2.3-54-g00ecf From 97b4576c115b86612a2ded6fbd800b6b5350d7a4 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 2 Nov 2009 17:28:03 -0500 Subject: script to register a user --- scripts/registeruser.php | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 scripts/registeruser.php diff --git a/scripts/registeruser.php b/scripts/registeruser.php new file mode 100644 index 000000000..9857f5aee --- /dev/null +++ b/scripts/registeruser.php @@ -0,0 +1,81 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'n:w:f:e:'; +$longoptions = array('nickname=', 'password=', 'fullname=', 'email='); + +$helptext = << $nickname, + 'password' => $password, + 'fullname' => $fullname)); + + if (empty($user)) { + throw new Exception("Can't register user '$nickname' with password '$password' and fullname '$fullname'."); + } + + if (!empty($email)) { + + $orig = clone($user); + + $user->email = $email; + + if (!$user->updateKeys($orig)) { + print "Failed!\n"; + throw new Exception("Can't update email address."); + } + } + +} catch (Exception $e) { + print $e->getMessage() . "\n"; + exit(1); +} -- cgit v1.2.3-54-g00ecf From 8e4bc78204e65589cebd5abab67db0f3b5fd8932 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 2 Nov 2009 18:06:09 -0500 Subject: correct name in registeruser --- scripts/registeruser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/registeruser.php b/scripts/registeruser.php index 9857f5aee..5d9c8862d 100644 --- a/scripts/registeruser.php +++ b/scripts/registeruser.php @@ -24,8 +24,8 @@ $shortoptions = 'n:w:f:e:'; $longoptions = array('nickname=', 'password=', 'fullname=', 'email='); $helptext = << Date: Mon, 2 Nov 2009 18:06:27 -0500 Subject: script to make someone a group admin --- scripts/makegroupadmin.php | 89 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 scripts/makegroupadmin.php diff --git a/scripts/makegroupadmin.php b/scripts/makegroupadmin.php new file mode 100644 index 000000000..a68798451 --- /dev/null +++ b/scripts/makegroupadmin.php @@ -0,0 +1,89 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); + +$shortoptions = 'g:n:'; +$longoptions = array('nickname=', 'group='); + +$helptext = << $group->id, + 'profile_id' => $user->id)); + + if (empty($member)) { + $member = new Group_member(); + + $member->group_id = $group->id; + $member->profile_id = $user->id; + $member->created = common_sql_now(); + + if (!$member->insert()) { + throw new Exception("Can't add '$nickname' to '$groupname'."); + } + } + + if ($member->is_admin) { + throw new Exception("'$nickname' is already an admin of '$groupname'."); + } + + $orig = clone($member); + + $member->is_admin = 1; + + if (!$member->update($orig)) { + throw new Exception("Can't make '$nickname' admin of '$groupname'."); + } + +} catch (Exception $e) { + print $e->getMessage() . "\n"; + exit(1); +} -- cgit v1.2.3-54-g00ecf From f757ba3ca2f3c7cd647a6cd4421e98c1e310483e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 2 Nov 2009 18:10:01 -0500 Subject: notes about registeruser and makegroupadmin scripts --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index b4c37e3ab..a10628ac7 100644 --- a/README +++ b/README @@ -150,6 +150,8 @@ released Aug 26 2009. Notable changes this version: - Use the NICKNAME_FMT constant for detecting nicknames. - Check for site servername config'd. - Compatibility fix for empty status updates with Twitter API. +- a script to register a new user. +- a script to make a user admin of a group. Prerequisites ============= -- cgit v1.2.3-54-g00ecf