本文整理汇总了PHP中Current_User::getEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP Current_User::getEmail方法的具体用法?PHP Current_User::getEmail怎么用?PHP Current_User::getEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Current_User
的用法示例。
在下文中一共展示了Current_User::getEmail方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userSignup
public function userSignup()
{
if (!$this->signup->sheet->id) {
PHPWS_Core::errorPage('404');
}
$sheet = $this->signup->sheet;
$peep = $this->signup->peep;
if (Current_User::isLogged() && empty($peep->email)) {
$peep->email = Current_User::getEmail();
}
if ($sheet->end_time < time()) {
$this->signup->title = dgettext('signup', 'Sorry');
$this->signup->content = dgettext('signup', 'We are no longer accepting applications.');
return;
}
$slots = $sheet->getAllSlots();
$slots_filled = $sheet->totalSlotsFilled();
if (empty($slots)) {
$this->signup->title = dgettext('signup', 'Sorry');
$this->signup->content = dgettext('signup', 'There is a problem with this signup sheet. Please check back later.');
return;
}
$this->signup->title =& $sheet->title;
foreach ($slots as $slot) {
// if the slots are filled, don't offer it
if ($slots_filled && isset($slots_filled[$slot->id])) {
$filled =& $slots_filled[$slot->id];
if ($filled >= $slot->openings) {
continue;
} else {
$openings_left = $slot->openings - $filled;
}
} else {
$openings_left =& $slot->openings;
}
$options[$slot->id] = sprintf(dngettext('signup', '%s (%s opening)', '%s (%s openings)', $openings_left), $slot->title, $openings_left);
}
if (!isset($options)) {
$this->signup->content = dgettext('signup', 'Sorry, but all available slots are full. Please check back later for possible cancellations.');
return;
} else {
$form = new PHPWS_Form('slots');
$form->useFieldset();
$form->setLegend(dgettext('signup', 'Signup form'));
$form->addHidden('module', 'signup');
$form->addHidden('uop', 'slot_signup');
$form->addHidden('sheet_id', $this->signup->sheet->id);
$form->addSelect('slot_id', $options);
$form->setLabel('slot_id', dgettext('signup', 'Available slots'));
$form->setMatch('slot_id', $peep->slot_id);
$form->addText('first_name', $peep->first_name);
$form->setLabel('first_name', dgettext('signup', 'First name'));
$form->addText('last_name', $peep->last_name);
$form->setLabel('last_name', dgettext('signup', 'Last name'));
$form->addText('email', $peep->email);
$form->setSize('email', 30);
$form->setLabel('email', dgettext('signup', 'Email address'));
$form->addText('phone', $peep->getPhone());
$form->setSize('phone', 15);
$form->setLabel('phone', dgettext('signup', 'Phone number'));
if (!empty($this->signup->sheet->extra1)) {
$form->addText('extra1', $peep->extra1);
$form->setLabel('extra1', $this->signup->sheet->extra1);
}
if (!empty($this->signup->sheet->extra2)) {
$form->addText('extra2', $peep->extra2);
$form->setLabel('extra2', $this->signup->sheet->extra2);
}
if (!empty($this->signup->sheet->extra3)) {
$form->addText('extra3', $peep->extra3);
$form->setLabel('extra3', $this->signup->sheet->extra3);
}
$form->addSubmit(dgettext('signup', 'Submit'));
$tpl = $form->getTemplate();
}
$tpl['DESCRIPTION'] = $sheet->getDescription();
$this->signup->content = PHPWS_Template::process($tpl, 'signup', 'signup_form.tpl');
$this->signup->sheet->flag();
}
示例2: send_emails
public function send_emails()
{
if (empty($_REQUEST['subject'])) {
return Notification::show_edit_email('You must fill in the subject line of the email.', '', $_REQUEST['body']);
} else {
if (empty($_REQUEST['body'])) {
return Notification::show_edit_email('You must fill in the message to be sent.', $_REQUEST['subject'], '');
}
}
$from = isset($_REQUEST['anonymous']) && Current_User::allow('hms', 'anonymous_notification') ? FROM_ADDRESS : Current_User::getEmail();
$subject = $_REQUEST['subject'];
$body = $_REQUEST['body'];
//Consider using a batch process instead of doing this this inline
PHPWS_Core::initModClass('hms', 'HMS_Residence_Hall.php');
PHPWS_Core::initModClass('hms', 'HMS_Email.php');
PHPWS_Core::initModClass('hms', 'HMS_Activity_Log.php');
// Log that this is happening
if ($from == FROM_ADDRESS) {
HMS_Activity_Log::log_activity(Current_User::getUsername(), ACTIVITY_ANON_NOTIFICATION_SENT, Current_User::getUsername());
} else {
HMS_Activity_Log::log_activity(Current_User::getUsername(), ACTIVITY_NOTIFICATION_SENT, Current_User::getUsername());
}
if (is_array($_REQUEST['hall'])) {
foreach ($_REQUEST['hall'] as $hall_id) {
$hall = new HMS_Residence_Hall($hall_id);
$floors = $hall->get_floors();
foreach ($floors as $floor) {
$rooms = $floor->get_rooms();
foreach ($rooms as $room) {
$students = $room->get_assignees();
foreach ($students as $student) {
HMS_Email::send_email($student->asu_username . '@appstate.edu', $from, $subject, $body);
}
}
}
if ($from == FROM_ADDRESS) {
HMS_Activity_Log::log_activity(Current_User::getUsername(), ACTIVITY_HALL_NOTIFIED_ANONYMOUSLY, Current_User::getUsername(), $hall->hall_name);
} else {
HMS_Activity_Log::log_activity(Current_User::getUsername(), ACTIVITY_HALL_NOTIFIED, Current_User::getUsername(), $hall->hall_name);
}
}
} else {
$hall = new HMS_Residence_Hall($_REQUEST['hall']);
$floors = $hall->get_floors();
foreach ($floors as $floor) {
$rooms = $floor->get_rooms();
foreach ($rooms as $room) {
$students = $room->get_assignees();
foreach ($students as $student) {
HMS_Email::send_email($student->asu_username . '@appstate.edu', $from, $subject, $body);
}
}
}
if ($from == FROM_ADDRESS) {
HMS_Activity_Log::log_activity(Current_User::getUsername(), ACTIVITY_HALL_NOTIFIED_ANONYMOUSLY, Current_User::getUsername(), $hall->hall_name);
} else {
HMS_Activity_Log::log_activity(Current_User::getUsername(), ACTIVITY_HALL_NOTIFIED, Current_User::getUsername(), $hall->hall_name);
}
}
return Notification::show_confirmation();
}