当前位置: 首页>>代码示例>>PHP>>正文


PHP Member::CurrentUser方法代码示例

本文整理汇总了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());
         }
     }
 }
开发者ID:helpfulrobot,项目名称:phuongle-silverstripe-member-registration,代码行数:15,代码来源:MemberPage.php

示例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;
 }
开发者ID:helpfulrobot,项目名称:phuongle-silverstripe-member-registration,代码行数:16,代码来源:EditProfilePage.php

示例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);
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:22,代码来源:MarketPlaceReviewForm.php

示例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());
 }
开发者ID:Thingee,项目名称:openstack-org,代码行数:14,代码来源:MarketPlaceReview.php

示例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"));
         }
     }
 }
开发者ID:vinstah,项目名称:body,代码行数:23,代码来源:UpcomingEventHolder.php

示例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);
 }
开发者ID:ss23,项目名称:deploynaut,代码行数:21,代码来源:Pipeline.php


注:本文中的Member::CurrentUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。