From 70521d55a811347fa30f37187e43b8a1fd932e21 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 27 Jun 2009 07:37:58 -0700 Subject: log IP for API auth errors --- actions/api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'actions') diff --git a/actions/api.php b/actions/api.php index 1fe5875ad..08f5fadad 100644 --- a/actions/api.php +++ b/actions/api.php @@ -67,7 +67,9 @@ class ApiAction extends Action $this->process_command(); } else { # basic authentication failed - common_log(LOG_WARNING, "Failed API auth attempt, nickname: $nickname."); + list($proxy, $ip) = common_client_ip(); + + common_log(LOG_WARNING, "Failed API auth attempt, nickname = $nickname, proxy = $proxy, ip = $ip."); $this->show_basic_auth_error(); } } -- cgit v1.2.3-54-g00ecf From d03b8c4276e5bd3822289a8b5c94be60cb90ef75 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 29 Jun 2009 10:22:17 -0400 Subject: show section with admins in sidebar of group --- actions/showgroup.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ classes/User_group.php | 24 ++++++++++++++++++++++++ 2 files changed, 68 insertions(+) (limited to 'actions') diff --git a/actions/showgroup.php b/actions/showgroup.php index b6a0f4844..ce11d574e 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -331,6 +331,7 @@ class ShowgroupAction extends GroupDesignAction { $this->showMembers(); $this->showStatistics(); + $this->showAdmins(); $cloud = new GroupTagCloudSection($this, $this->group); $cloud->show(); } @@ -369,6 +370,18 @@ class ShowgroupAction extends GroupDesignAction $this->elementEnd('div'); } + /** + * Show list of admins + * + * @return void + */ + + function showAdmins() + { + $adminSection = new GroupAdminSection($this, $this->group); + $adminSection->show(); + } + /** * Show some statistics * @@ -423,3 +436,34 @@ class ShowgroupAction extends GroupDesignAction $this->elementEnd('div'); } } + +class GroupAdminSection extends ProfileSection +{ + var $group; + + function __construct($out, $group) + { + parent::__construct($out); + $this->group = $group; + } + + function getProfiles() + { + return $this->group->getAdmins(); + } + + function title() + { + return _('Admins'); + } + + function divId() + { + return 'group_admins'; + } + + function moreUrl() + { + return null; + } +} \ No newline at end of file diff --git a/classes/User_group.php b/classes/User_group.php index 9b4b01ead..27b444705 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -126,6 +126,30 @@ class User_group extends Memcached_DataObject return $members; } + function getAdmins($offset=0, $limit=null) + { + $qry = + 'SELECT profile.* ' . + 'FROM profile JOIN group_member '. + 'ON profile.id = group_member.profile_id ' . + 'WHERE group_member.group_id = %d ' . + 'AND group_member.is_admin = 1 ' . + 'ORDER BY group_member.modified ASC '; + + if ($limit != null) { + if (common_config('db','type') == 'pgsql') { + $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; + } else { + $qry .= ' LIMIT ' . $offset . ', ' . $limit; + } + } + + $admins = new Profile(); + + $admins->query(sprintf($qry, $this->id)); + return $admins; + } + function getBlocked($offset=0, $limit=null) { $qry = -- cgit v1.2.3-54-g00ecf From 5b8e40aaa9bdb0c07cce0cf53cd913b0c397fdc4 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 29 Jun 2009 10:29:11 -0400 Subject: admin indicators in groups --- actions/groupmembers.php | 9 +++++++++ theme/base/css/display.css | 18 +++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'actions') diff --git a/actions/groupmembers.php b/actions/groupmembers.php index d132cdf96..be7a9e81c 100644 --- a/actions/groupmembers.php +++ b/actions/groupmembers.php @@ -167,6 +167,15 @@ class GroupMemberListItem extends ProfileListItem $this->group = $group; } + function showFullName() + { + parent::showFullName(); + if ($this->profile->isAdmin($this->group)) { + $this->out->text(' '); + $this->out->element('span', 'admin_indicator', _('Admin')); + } + } + function showActions() { $this->startActions(); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 78fcd7ece..df4e75633 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -206,7 +206,6 @@ border-radius:4px; padding:0 7px; } - .form_settings input.form_action-primary { padding:0; } @@ -270,7 +269,6 @@ clear:both; margin-bottom:18px; } - #anon_notice { float:left; width:43.2%; @@ -285,7 +283,6 @@ font-size:1.1em; font-weight:bold; } - #footer { float:left; width:64%; @@ -597,7 +594,6 @@ display:none; } /* entity_profile */ - /*entity_actions*/ .entity_actions { float:right; @@ -726,7 +722,6 @@ margin-bottom:0; min-height:60px; } - .profile .form_group_join legend, .profile .form_group_leave legend, .profile .form_user_subscribe legend, @@ -761,13 +756,11 @@ display:inline; margin-right:11px; } - .profile .entity_profile .form_subscription_edit label { font-weight:normal; margin-right:11px; } - /* NOTICE */ .notice, .profile { @@ -790,7 +783,6 @@ width:95%; float:left; } - /* NOTICES */ #notices_primary { float:left; @@ -962,7 +954,6 @@ border:0; padding:0; } - .notice .attachment { position:relative; padding-left:16px; @@ -1059,7 +1050,6 @@ margin-bottom:18px; padding-left:20px; } - #filter_tags { margin-bottom:11px; float:left; @@ -1105,8 +1095,6 @@ top:3px; left:3px; } - - .pagination { float:left; clear:both; @@ -1152,7 +1140,6 @@ padding-right:30px; } /* END: NOTICE */ - .hentry .entry-content p { margin-bottom:18px; } @@ -1169,7 +1156,6 @@ margin-bottom:18px; margin-left:18px; } - /* TOP_POSTERS */ .section tbody td { padding-right:18px; @@ -1197,7 +1183,6 @@ margin-right:0; display:none; } - /* tagcloud */ .tag-cloud { list-style-type:none; @@ -1314,3 +1299,6 @@ display:none; .guide { clear:both; } +.admin_indicator { +font-style:italic; +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf