From 3be120571446880cb71a57845204b3213e6df67e Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 9 Nov 2009 17:43:37 -0500 Subject: Add a new event: CanUserChangeField --- actions/passwordsettings.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actions') diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php index 6658d279f..15539d4a0 100644 --- a/actions/passwordsettings.php +++ b/actions/passwordsettings.php @@ -58,6 +58,19 @@ class PasswordsettingsAction extends AccountSettingsAction return _('Change password'); } + function prepare($args){ + parent::prepare($args); + + $user = common_current_user(); + + Event::handle('CanUserChangeField', array($user->nickname, 'password')); + + if(! $fields['password']){ + //user is not allowed to change his password + $this->clientError(_('You are not allowed to change your password')); + } + } + /** * Instructions for use * @@ -86,6 +99,7 @@ class PasswordsettingsAction extends AccountSettingsAction function showContent() { $user = common_current_user(); + $this->elementStart('form', array('method' => 'POST', 'id' => 'form_password', 'class' => 'form_settings', -- cgit v1.2.3-54-g00ecf From 2f3e414cd1226b328a63854592f0783a9088baae Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 10 Nov 2009 13:08:58 +0000 Subject: Updated group block markup --- actions/groupblock.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'actions') diff --git a/actions/groupblock.php b/actions/groupblock.php index 133101eb7..fe09cbc2d 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -151,17 +151,19 @@ class GroupblockAction extends Action function areYouSureForm() { $id = $this->profile->id; + $this->elementStart('form', array('id' => 'block-' . $id, + 'method' => 'post', + 'class' => 'form_settings form_entity_block', + 'action' => common_local_url('groupblock'))); + $this->elementStart('fieldset'); + $this->hidden('token', common_session_token()); + $this->element('legend', _('Block user')); $this->element('p', null, sprintf(_('Are you sure you want to block user "%s" from the group "%s"? '. 'They will be removed from the group, unable to post, and '. 'unable to subscribe to the group in the future.'), $this->profile->getBestName(), $this->group->getBestName())); - $this->elementStart('form', array('id' => 'block-' . $id, - 'method' => 'post', - 'class' => 'block', - 'action' => common_local_url('groupblock'))); - $this->hidden('token', common_session_token()); $this->hidden('blockto-' . $this->profile->id, $this->profile->id, 'blockto'); @@ -173,8 +175,9 @@ class GroupblockAction extends Action $this->hidden($k, $v); } } - $this->submit('no', _('No')); - $this->submit('yes', _('Yes')); + $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group")); + $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group')); + $this->elementEnd('fieldset'); $this->elementEnd('form'); } -- cgit v1.2.3-54-g00ecf From 91da72ede0b834d017165ececdc340ec0a24227b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 10 Nov 2009 13:09:15 +0000 Subject: Updated block @title text (shouldn't say from group) --- actions/block.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/block.php b/actions/block.php index 408f16434..b125d2d8b 100644 --- a/actions/block.php +++ b/actions/block.php @@ -146,8 +146,8 @@ class BlockAction extends Action $this->hidden($k, $v); } } - $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user from this group")); - $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user from this group')); + $this->submit('form_action-no', _('No'), 'submit form_action-primary', 'no', _("Do not block this user")); + $this->submit('form_action-yes', _('Yes'), 'submit form_action-secondary', 'yes', _('Block this user')); $this->elementEnd('fieldset'); $this->elementEnd('form'); } -- cgit v1.2.3-54-g00ecf