本文整理汇总了PHP中Member::CurrentUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::CurrentUser方法的具体用法?PHP Member::CurrentUser怎么用?PHP Member::CurrentUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::CurrentUser方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$Member = Member::CurrentUser();
if ($Member == null) {
//echo "do resgistration";
if ($RegistrationPage = DataObject::get_one('RegistrationPage')) {
return $this->redirect($RegistrationPage->Link());
}
} else {
//echo "do edit registration";
if ($EditProfilePage = DataObject::get_one('EditProfilePage')) {
return $this->redirect($EditProfilePage->Link());
}
}
}
示例2: EditProfileForm
function EditProfileForm()
{
//Create our fields
$fields = new FieldList(new TextField('FirstName', '<span>*</span> Firstname'), new TextField('Surname', '<span>*</span> Surname'), new EmailField('Email', '<span>*</span> Email'), new TextField('JobTitle', 'Job Title'), new TextField('Website', 'Website (Without http://)'), new TextareaField('Blurb'), new ConfirmedPasswordField('Password', 'New Password'));
// Create action
$actions = new FieldList(new FormAction('SaveProfile', 'Save'));
// Create action
$validator = new RequiredFields('FirstName', 'Email');
//Create form
$Form = new Form($this, 'EditProfileForm', $fields, $actions, $validator);
//Populate the form with the current members data
$Member = Member::CurrentUser();
$Form->loadDataFrom($Member->data());
//Return the form
return $Form;
}
示例3: __construct
function __construct($controller, $name, $use_actions = true)
{
$RatingField = new TextField('rating', '');
$RatingField->setValue(0);
$TitleField = new TextField('title', 'Title');
$CommentField = new HtmlEditorField('comment', 'Comment');
$CommentField->setRows(8);
$CompanyServiceIDField = new HiddenField('company_service_ID', '');
$CompanyServiceIDField->setValue($controller->company_service_ID);
$LoggedInField = new HiddenField('logged_in', '');
if (Member::CurrentUser()) {
$LoggedInField->setValue(1);
}
$fields = new FieldList($RatingField, $TitleField, $CommentField, $CompanyServiceIDField, $LoggedInField);
// Create action
$actions = new FieldList();
if ($use_actions) {
$actions->push(new FormAction('saveReview', 'Submit'));
}
$this->addExtraClass('review-form');
parent::__construct($controller, $name, $fields, $actions);
}
示例4: registerReviewMainInfo
/**
* @param ReviewMainInfo $info
* @return void
*/
public function registerReviewMainInfo(ReviewMainInfo $info)
{
if ($this->Title != $info->getTitle() || $this->Comment != $info->getComment() || $this->Rating != $info->getRating()) {
$this->Approved = 0;
}
$this->Title = $info->getTitle();
$this->Comment = $info->getComment();
$this->Rating = $info->getRating();
$this->setMember(Member::CurrentUser());
}
示例5: RegisterForEventByInvoice
public function RegisterForEventByInvoice()
{
if ($member = Member::CurrentUser()) {
$id = "";
$eventId = $this->myEvent['Id'];
$contactId = $member->MagnetismID;
$groupId = "";
$registrationDate = Date('Y-m-d');
$paymentDate = $registrationDate;
$price = $this->myEvent['Price'];
$statusReason = 1;
$statusReasonName = "placeholder string";
$paid = false;
$attended = true;
$details = "placeholder string";
$sendArray = array("Id" => $id, "EventId" => $eventId, "ContactId" => $contactId, "GroupId" => $groupId, "RegistrationDate" => $registrationDate, "PaymentDate" => $paymentDate, "Price" => $price, "StatusReason" => $statusReason, "StatusReasonName" => $statusReasonName, "Paid" => $paid, "Attended" => $attended, "Details" => $details);
$obj = MagnetismConnect::magnetism_connect_singleton();
$result = $obj->registerForEvent($sendArray);
if ($result) {
Controller::redirect($this->Link("?name={$this->myEventName}&success=1"));
}
}
}
示例6: markAborted
/**
* Mark this Pipeline as aborted
*
* @return void
*/
public function markAborted()
{
$this->Status = 'Aborted';
$logMessage = sprintf("Pipeline processing aborted. %s (%s) aborted the pipeline", Member::CurrentUser()->Name, Member::CurrentUser()->Email);
$this->log($logMessage);
$this->write();
// Abort all running or queued steps.
$steps = $this->Steps();
foreach ($steps as $step) {
if ($step->isQueued() || $step->isRunning()) {
$step->abort();
}
}
// Send notification to users about this event
$this->sendMessage(self::ALERT_ABORT);
}