parent
a34fa2ecbc
commit
55c168ebc4
@ -48,8 +48,11 @@ final class PasswordManager {
|
|||||||
* @throws PasswordMismatchException
|
* @throws PasswordMismatchException
|
||||||
*/
|
*/
|
||||||
public function changePassword($token, $password, $password_confirmation){
|
public function changePassword($token, $password, $password_confirmation){
|
||||||
if(empty($token)) throw new InvalidResetPasswordTokenException;
|
$member = Member::currentUser();
|
||||||
$member = Member::member_from_autologinhash($token);
|
if(!$member) {
|
||||||
|
if (empty($token)) throw new InvalidResetPasswordTokenException;
|
||||||
|
$member = Member::member_from_autologinhash($token);
|
||||||
|
}
|
||||||
if(!$member) throw new InvalidResetPasswordTokenException;
|
if(!$member) throw new InvalidResetPasswordTokenException;
|
||||||
if(empty($password)) throw new EmptyPasswordException;
|
if(empty($password)) throw new EmptyPasswordException;
|
||||||
if($password !== $password_confirmation) throw new PasswordMismatchException;
|
if($password !== $password_confirmation) throw new PasswordMismatchException;
|
||||||
|
@ -48,7 +48,7 @@ final class CustomChangePasswordForm extends ChangePasswordForm {
|
|||||||
}
|
}
|
||||||
catch(InvalidResetPasswordTokenException $ex1){
|
catch(InvalidResetPasswordTokenException $ex1){
|
||||||
Session::clear('AutoLoginHash');
|
Session::clear('AutoLoginHash');
|
||||||
Controller::curr()->redirect('loginpage');
|
Controller::curr()->redirect('login');
|
||||||
}
|
}
|
||||||
catch(EmptyPasswordException $ex2){
|
catch(EmptyPasswordException $ex2){
|
||||||
$this->clearMessage();
|
$this->clearMessage();
|
||||||
|
@ -63,11 +63,25 @@ class CustomPasswordController extends Security {
|
|||||||
'Form' => $this->ChangePasswordForm(),
|
'Form' => $this->ChangePasswordForm(),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
else{
|
else if(isset($_REQUEST['t']) && isset($_REQUEST['m'])){
|
||||||
$new_hash = $this->password_manager->verifyToken((int)@$_REQUEST['m'], @$_REQUEST['t']);
|
$new_hash = $this->password_manager->verifyToken((int)@$_REQUEST['m'], @$_REQUEST['t']);
|
||||||
Session::set('AutoLoginHash', $new_hash);
|
Session::set('AutoLoginHash', $new_hash);
|
||||||
return $this->redirect($this->Link('changepassword'));
|
return $this->redirect($this->Link('changepassword'));
|
||||||
}
|
}
|
||||||
|
else if(Member::currentUser()) {
|
||||||
|
// Logged in user requested a password change form.
|
||||||
|
$customisedController = $controller->customise(array(
|
||||||
|
'Content' => '<p>'
|
||||||
|
. _t('Security.CHANGEPASSWORDBELOW', 'You can change your password below.') . '</p>',
|
||||||
|
'Form' => $this->ChangePasswordForm()));
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
self::permissionFailure(
|
||||||
|
$this,
|
||||||
|
_t('Security.ERRORPASSWORDPERMISSION', 'You must be logged in in order to change your password!')
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(InvalidPasswordResetLinkException $ex1){
|
catch(InvalidPasswordResetLinkException $ex1){
|
||||||
$customisedController = $controller->customise(
|
$customisedController = $controller->customise(
|
||||||
|
@ -25,7 +25,7 @@ class CandidateApplicationForm extends HoneyPotForm {
|
|||||||
new TextAreaField('TopPriority',"What do you think the top priority of the Board should be in 2015?")
|
new TextAreaField('TopPriority',"What do you think the top priority of the Board should be in 2015?")
|
||||||
);
|
);
|
||||||
|
|
||||||
$actionButton = new FormAction('save', 'Save Candidate Application');
|
$actionButton = new FormAction('saveCandidateApplicationForm', 'Save Candidate Application');
|
||||||
//$actionButton->addExtraClass('btn green-btn');
|
//$actionButton->addExtraClass('btn green-btn');
|
||||||
|
|
||||||
$actions = new FieldList(
|
$actions = new FieldList(
|
||||||
|
@ -141,7 +141,7 @@ class MemberListPage_Controller extends Page_Controller
|
|||||||
// Check to see if the candidate ID is numeric and if the person is logged in
|
// Check to see if the candidate ID is numeric and if the person is logged in
|
||||||
if ($this->validateNomation($CandidateID) == 'VALID') {
|
if ($this->validateNomation($CandidateID) == 'VALID') {
|
||||||
|
|
||||||
$Nominee = Member::get()->filter(array('ID' => $CandidateID));
|
$Nominee = Member::get()->filter(array('ID' => $CandidateID))->first();
|
||||||
$results["Success"] = TRUE;
|
$results["Success"] = TRUE;
|
||||||
$results["Candidate"] = $Nominee;
|
$results["Candidate"] = $Nominee;
|
||||||
$results["NominateLink"] = $this->Link() . "saveNomination/" . $CandidateID;
|
$results["NominateLink"] = $this->Link() . "saveNomination/" . $CandidateID;
|
||||||
@ -149,7 +149,7 @@ class MemberListPage_Controller extends Page_Controller
|
|||||||
|
|
||||||
} elseif ($this->validateNomation($CandidateID) == 'ALREADY NOMINATED') {
|
} elseif ($this->validateNomation($CandidateID) == 'ALREADY NOMINATED') {
|
||||||
|
|
||||||
$Nominee = Member::get()->filter(array('ID' => $CandidateID));
|
$Nominee = Member::get()->filter(array('ID' => $CandidateID))->first();
|
||||||
|
|
||||||
$CurrentElection = $this->CurrentElection();
|
$CurrentElection = $this->CurrentElection();
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ class MemberListPage_Controller extends Page_Controller
|
|||||||
|
|
||||||
} elseif ($this->validateNomation($CandidateID) == 'LIMIT EXCEEDED') {
|
} elseif ($this->validateNomation($CandidateID) == 'LIMIT EXCEEDED') {
|
||||||
|
|
||||||
$Nominee = Member::get()->filter(array('ID' => $CandidateID));
|
$Nominee = Member::get()->filter(array('ID' => $CandidateID))->first();
|
||||||
|
|
||||||
$results["Success"] = FALSE;
|
$results["Success"] = FALSE;
|
||||||
$results["LimitExceeded"] = TRUE;
|
$results["LimitExceeded"] = TRUE;
|
||||||
@ -223,7 +223,7 @@ class MemberListPage_Controller extends Page_Controller
|
|||||||
|
|
||||||
// 6. Make sure that the person nominating is a foundation member
|
// 6. Make sure that the person nominating is a foundation member
|
||||||
$CurrentMember = Member::currentUser();
|
$CurrentMember = Member::currentUser();
|
||||||
If (!$CurrentMember->inGroup(5, TRUE)) {
|
If (!$CurrentMember->isFoundationMember()) {
|
||||||
return 'INVALID VOTER';
|
return 'INVALID VOTER';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,8 @@ class MemberListPage_Controller extends Page_Controller
|
|||||||
|
|
||||||
function saveNomination()
|
function saveNomination()
|
||||||
{
|
{
|
||||||
$CandidateID = $this->request->param("OtherID");
|
// Grab candidate ID from the URL
|
||||||
|
$CandidateID = $this->request->param("ID");
|
||||||
$NominationStatus = $this->validateNomation($CandidateID);
|
$NominationStatus = $this->validateNomation($CandidateID);
|
||||||
|
|
||||||
// Check to see if this is a valid nomination
|
// Check to see if this is a valid nomination
|
||||||
@ -275,30 +276,20 @@ class MemberListPage_Controller extends Page_Controller
|
|||||||
fclose($file);
|
fclose($file);
|
||||||
|
|
||||||
// Email the member
|
// Email the member
|
||||||
|
|
||||||
// In dev and testing, send the nomination emails to the person who did the nomination
|
// In dev and testing, send the nomination emails to the person who did the nomination
|
||||||
$To = $currentMember->Email;
|
$To = $currentMember->Email;
|
||||||
|
|
||||||
// In live mode, send the email to the candidate
|
// In live mode, send the email to the candidate
|
||||||
if (Director::isLive()) $To = $Candidate->Member()->Email;
|
if (Director::isLive()) $To = $Candidate->Member()->Email;
|
||||||
|
|
||||||
$Subject = "You have been nominated in the " . $CurrentElection->Title;
|
$Subject = "You have been nominated in the " . $CurrentElection->Title;
|
||||||
$email = EmailFactory::getInstance()->buildEmail(CANDIDATE_NOMINATION_FROM_EMAIL, $To, $Subject);
|
$email = EmailFactory::getInstance()->buildEmail(CANDIDATE_NOMINATION_FROM_EMAIL, $To, $Subject);
|
||||||
$email->setTemplate('NominationEmail');
|
$email->setTemplate('NominationEmail');
|
||||||
|
|
||||||
// Gather Data to send to template
|
// Gather Data to send to template
|
||||||
$data["Candidate"] = $Candidate;
|
$data["Candidate"] = $Candidate;
|
||||||
$data["Election"] = $CurrentElection;
|
$data["Election"] = $CurrentElection;
|
||||||
|
|
||||||
|
|
||||||
$email->populateTemplate($data);
|
$email->populateTemplate($data);
|
||||||
$email->send();
|
$email->send();
|
||||||
|
|
||||||
|
|
||||||
$this->setMessage('Success', "You've just nominated " . $Candidate->Member()->FirstName . ' for the OpenStack Board.');
|
$this->setMessage('Success', "You've just nominated " . $Candidate->Member()->FirstName . ' for the OpenStack Board.');
|
||||||
$this->redirect('/community/members/candidateStats/' . $Candidate->Member()->ID);
|
$this->redirect($this->Link('candidateStats/' . $Candidate->Member()->ID));
|
||||||
|
|
||||||
|
|
||||||
} elseif ($NominationStatus = 'ALREADY NOMINATED') {
|
} elseif ($NominationStatus = 'ALREADY NOMINATED') {
|
||||||
|
|
||||||
$this->setMessage('Error', "Oops, you have already nominated this person.");
|
$this->setMessage('Error', "Oops, you have already nominated this person.");
|
||||||
@ -350,7 +341,7 @@ class MemberListPage_Controller extends Page_Controller
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Grab candidate ID from the URL
|
// Grab candidate ID from the URL
|
||||||
$CandidateID = $this->request->param("OtherID");
|
$CandidateID = $this->request->param("ID");
|
||||||
|
|
||||||
// Check to see if the candidate is valid
|
// Check to see if the candidate is valid
|
||||||
if (is_numeric($CandidateID) && $this->findMember($CandidateID)) {
|
if (is_numeric($CandidateID) && $this->findMember($CandidateID)) {
|
||||||
|
@ -211,11 +211,7 @@ class EditProfileForm extends SafeXSSForm {
|
|||||||
$fields->push(new LiteralField('break', '<hr/>'));
|
$fields->push(new LiteralField('break', '<hr/>'));
|
||||||
|
|
||||||
|
|
||||||
$fields->push($password = new ConfirmedPasswordField('Password',
|
$fields->push(new LiteralField('changepassword','<a href="/Security/changepassword">Click here to change your password</a>'));
|
||||||
'Password'
|
|
||||||
));
|
|
||||||
|
|
||||||
$password->setCanBeEmpty(true);
|
|
||||||
|
|
||||||
|
|
||||||
// Create action
|
// Create action
|
||||||
|
@ -225,11 +225,6 @@ class EditProfilePage_Controller extends Page_Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function FoundationMember()
|
|
||||||
{
|
|
||||||
// see if the member is in the foundation group
|
|
||||||
if (Member::currentUser() && Member::currentUser()->inGroup('foundation-members')) return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
function CompanyAdmin()
|
function CompanyAdmin()
|
||||||
{
|
{
|
||||||
@ -339,7 +334,7 @@ class EditProfilePage_Controller extends Page_Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save an edited candidate
|
// Save an edited candidate
|
||||||
function save($data, $form)
|
function saveCandidateApplicationForm($data, $form)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@ -408,18 +403,19 @@ class EditProfilePage_Controller extends Page_Controller
|
|||||||
$form->saveInto($Candidate);
|
$form->saveInto($Candidate);
|
||||||
$Candidate->write();
|
$Candidate->write();
|
||||||
|
|
||||||
$this->setMessage('Success', 'Your edits have been saved but you will need to provide full answers to all these questions to be eligible as a candidate.');
|
$form->clearMessage();
|
||||||
|
$form->sessionMessage( "Your edits have been saved but you will need to provide full answers to all these questions to be eligible as a candidate.","bad");
|
||||||
$this->redirectBack();
|
$this->redirectBack();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$Candidate->HasAcceptedNomination = TRUE;
|
$Candidate->HasAcceptedNomination = TRUE;
|
||||||
$Candidate->write();
|
$Candidate->write();
|
||||||
|
$form->clearMessage();
|
||||||
$this->setMessage('Success', 'Congratulations. You have accepted your nomination as a candidate. Good luck in the election!');
|
|
||||||
$this->redirect($this->Link() . 'election/');
|
$this->redirect($this->Link() . 'election/');
|
||||||
} else {
|
} else {
|
||||||
$this->setMessage('Error', 'There was an error saving your edits.');
|
$form->clearMessage();
|
||||||
|
$form->sessionMessage('There was an error saving your edits.',"bad");
|
||||||
$this->redirectBack();
|
$this->redirectBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +65,6 @@ jQuery(document).ready(function($) {
|
|||||||
City:{required: true},
|
City:{required: true},
|
||||||
State:{required: true},
|
State:{required: true},
|
||||||
Postcode:{required: true},
|
Postcode:{required: true},
|
||||||
'Password[_Password]': {required: true,minlength: 5},
|
|
||||||
'Password[_ConfirmPassword]': {required: true,minlength: 5,equalTo: '#Password-_Password'},
|
|
||||||
'Affiliations':{checkAffiliations:true},
|
'Affiliations':{checkAffiliations:true},
|
||||||
'Gender':{required:true}
|
'Gender':{required:true}
|
||||||
},
|
},
|
||||||
|
@ -1,18 +1,12 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<% require javascript(sapphire/thirdparty/tinymce/tiny_mce.js) %>
|
<% require javascript(framework/thirdparty/tinymce/tiny_mce.js) %>
|
||||||
<% require javascript(themes/openstack/javascript/simple-tinymce.js) %>
|
<% require javascript(themes/openstack/javascript/simple-tinymce.js) %>
|
||||||
|
|
||||||
<% require themedCSS(profile-section) %>
|
<% require themedCSS(profile-section) %>
|
||||||
|
<% if CurrentMember.isFoundationMember %>
|
||||||
|
|
||||||
<% if FoundationMember %>
|
|
||||||
|
|
||||||
<h1>Accept Nomination</h1>
|
<h1>Accept Nomination</h1>
|
||||||
<p>To accept nominations and be listed as a candidate for the OpenStack election, please answer the questions below.</p>
|
<p>To accept nominations and be listed as a candidate for the OpenStack election, please answer the questions below.</p>
|
||||||
<h2>Candidate Application Form</h2>
|
<h2>Candidate Application Form</h2>
|
||||||
$CandidateApplicationForm
|
$CandidateApplicationForm
|
||||||
|
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<p>In order to edit your community profile, you will first need to <a href="/Security/login/?BackURL=%2Fprofile%2F">login as a member</a>. Don't have an account? <a href="/join/">Join The Foundation</a></p>
|
<p>In order to edit your community profile, you will first need to <a href="/Security/login/?BackURL=%2Fprofile%2F">login as a member</a>. Don't have an account? <a href="/join/">Join The Foundation</a></p>
|
||||||
<p><a class="roundedButton" href="/Security/login/?BackURL=%2Fprofile%2F">Login</a> <a href="/join/" class="roundedButton">Join The Foundation</a></p>
|
<p><a class="roundedButton" href="/Security/login/?BackURL=%2Fprofile%2F">Login</a> <a href="/join/" class="roundedButton">Join The Foundation</a></p>
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
$SetCurrentTab(2)
|
$SetCurrentTab(2)
|
||||||
|
|
||||||
<% require themedCSS(profile-section) %>
|
<% require themedCSS(profile-section) %>
|
||||||
|
<h1>$Title</h1>
|
||||||
<h1>$Title</h1>
|
<% if CurrentMember.isFoundationMember %>
|
||||||
|
|
||||||
|
|
||||||
<% if FoundationMember %>
|
|
||||||
|
|
||||||
<% include ProfileNav %>
|
<% include ProfileNav %>
|
||||||
|
|
||||||
@ -66,4 +62,5 @@
|
|||||||
<p>In order to edit your community profile, you will first need to <a href="/Security/login/?BackURL=%2Fprofile%2F">login as a member</a>. Don't have an account? <a href="/join/">Join The Foundation</a></p>
|
<p>In order to edit your community profile, you will first need to <a href="/Security/login/?BackURL=%2Fprofile%2F">login as a member</a>. Don't have an account? <a href="/join/">Join The Foundation</a></p>
|
||||||
<p><a class="roundedButton" href="/Security/login/?BackURL=%2Fprofile%2Felection%2F">Login</a> <a href="/join/" class="roundedButton">Join The Foundation</a></p>
|
<p><a class="roundedButton" href="/Security/login/?BackURL=%2Fprofile%2Felection%2F">Login</a> <a href="/join/" class="roundedButton">Join The Foundation</a></p>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
</div></div>
|
</div>
|
||||||
|
</div>
|
||||||
|
@ -1,31 +1,25 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
|
<% require javascript(framework/thirdparty/tinymce/tiny_mce.js) %>
|
||||||
$SetCurrentTab(7)
|
<% require javascript(themes/openstack/javascript/simple-tinymce.js) %>
|
||||||
|
$SetCurrentTab(7)
|
||||||
<% require themedCSS(profile-section) %>
|
<% require themedCSS(profile-section) %>
|
||||||
|
<h1>$Title</h1>
|
||||||
<h1>$Title</h1>
|
<% if CurrentMember %>
|
||||||
|
<% if Saved %>
|
||||||
|
|
||||||
<% if CurrentMember %>
|
<div class="span-24 last siteMessage" id="SuccessMessage">
|
||||||
<% if Saved %>
|
<p>Your Profile has been saved!</p>
|
||||||
|
</div>
|
||||||
<div class="span-24 last siteMessage" id="SuccessMessage">
|
<% end_if %>
|
||||||
<p>Your Profile has been saved!</p>
|
<% include ProfileNav %>
|
||||||
</div>
|
$EditSpeakerProfileForm
|
||||||
|
<% else %>
|
||||||
|
<p>In order to edit your community profile, you will first need to <a
|
||||||
<% end_if %>
|
href="/Security/login/?BackURL=%2Fprofile%2F">login as a member</a>. Don't have an account? <a
|
||||||
|
href="/join/">Join The Foundation</a></p>
|
||||||
<% include ProfileNav %>
|
|
||||||
|
<p><a class="roundedButton" href="/Security/login/?BackURL=%2Fprofile%2F">Login</a> <a href="/join/"
|
||||||
|
class="roundedButton">Join
|
||||||
$EditSpeakerProfileForm
|
The Foundation</a></p>
|
||||||
|
<% end_if %>
|
||||||
|
</div></div>
|
||||||
|
|
||||||
<% else %>
|
|
||||||
<p>In order to edit your community profile, you will first need to <a href="/Security/login/?BackURL=%2Fprofile%2F">login as a member</a>. Don't have an account? <a href="/join/">Join The Foundation</a></p>
|
|
||||||
<p><a class="roundedButton" href="/Security/login/?BackURL=%2Fprofile%2F">Login</a> <a href="/join/" class="roundedButton">Join The Foundation</a></p>
|
|
||||||
<% end_if %>
|
|
||||||
</div></div>
|
|
@ -3,7 +3,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<h2 class="profile-tabs">
|
<h2 class="profile-tabs">
|
||||||
<a href="{$Link}" <% if CurrentTab=1 %>class="active"<% end_if %> >Your Details</a>
|
<a href="{$Link}" <% if CurrentTab=1 %>class="active"<% end_if %> >Your Details</a>
|
||||||
<% if FoundationMember %>
|
<% if CurrentMember.isFoundationMember %>
|
||||||
<a href="{$Link}election" <% if CurrentTab=2 %>class="active"<% end_if %> >Election</a>
|
<a href="{$Link}election" <% if CurrentTab=2 %>class="active"<% end_if %> >Election</a>
|
||||||
<% end_if %>
|
<% end_if %>
|
||||||
<a href="{$Link}agreements" <% if CurrentTab=3 %>class="active"<% end_if %> >Legal Agreements</a>
|
<a href="{$Link}agreements" <% if CurrentTab=3 %>class="active"<% end_if %> >Legal Agreements</a>
|
||||||
|
@ -4,15 +4,17 @@
|
|||||||
|
|
||||||
<h1>Please confirm your nomination</h1>
|
<h1>Please confirm your nomination</h1>
|
||||||
|
|
||||||
<p>Are you sure you would officially like to nominate <strong>$Candidate.FirstName $Candidate.Surname</strong> to the OpenStack Board?</p>
|
<p>Are you sure you would officially like to nominate <strong>$Candidate.FirstName $Candidate.Surname</strong> to the OpenStack Board?</p>
|
||||||
|
|
||||||
<p><a class="roundedButton" href="$NominateLink">Yes, Nominate $Candidate.FirstName</a> <a class="roundedButton" href="{$Link}profile/$Candidate.ID">No</a></p>
|
<p><a class="roundedButton" href="$NominateLink">Yes, Nominate $Candidate.FirstName</a> <a class="roundedButton" href="{$Link}profile/$Candidate.ID">No</a></p>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
<% if NominatedByMe %>
|
<% if NominatedByMe %>
|
||||||
<h1>You have already nominated $Candidate.FirstName $Candidate.Surname.</h1>
|
<% with Candidate %>
|
||||||
<p><a class="roundedButton" href="{$Election.Link}CandidateList/">See Nominations</a> <a class="roundedButton" href="{$Link}">See All Members</a></p>
|
<h1>You have already nominated $FirstName $Surname.</h1>
|
||||||
|
<% end_with %>
|
||||||
|
<p><a class="roundedButton" href="{$Election.Link}CandidateList/">See Nominations</a> <a class="roundedButton" href="{$Link}">See All Members</a></p>
|
||||||
<% else_if LimitExceeded %>
|
<% else_if LimitExceeded %>
|
||||||
<h1>This candidate has already received 10 nominations.</h1>
|
<h1>This candidate has already received 10 nominations.</h1>
|
||||||
<p>That's all the nominations that are required to appear on the election ballot. You may want to nominate someone else who you think would be a good candidate.</p>
|
<p>That's all the nominations that are required to appear on the election ballot. You may want to nominate someone else who you think would be a good candidate.</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user