public function postContact() { $input = Input::all(); $data = array('name' => $input['name'], 'surname' => $input['surname'], 'street' => $input['street'], 'city' => $input['city'], 'state' => $input['state'], 'zip' => $input['zip'], 'telephone' => $input['telephone'], 'email' => $input['email'], 'bedroom' => $input['bedroom'], 'price' => $input['price'], 'broker' => $input['broker'], 'question' => $input['question'], 'company' => $input['company'], 'notes' => $input['notes']); $registration = RegistrationPage::create($data); Mail::send('emails.welcome', array('data' => $data), function ($message) { $message->from('*****@*****.**', '465 Pacific'); $message->to(Input::get('email'), Input::get('name') . " " . Input::get('surname'))->subject('465 Pacific Confirmation'); }); return Redirect::route('tnx.get'); }
public function onBeforeWrite() { parent::onBeforeWrite(); if (!$this->owner->MemberNumber) { $this->owner->MemberNumber = Member::get()->sort('ID')->last()->ID + 300; } if (!$this->owner->JoinedDate && $this->owner->MembershipStatus === 'Verified') { $this->owner->JoinedDate = date('Y-m-d'); } if ($this->owner->isChanged('MembershipStatus') && $this->owner->MembershipStatus === 'Verified') { $email = new MemberApprovalEmail(RegistrationPage::get_one('RegistrationPage'), $this->owner); $email->send(); $this->Notified = 0; } }
public static function getInstance($path, $params) { if (!count($path)) { self::redirectTo('home'); exit; } $pname = $path[0]; $path = self::nextPath($path); switch ($pname) { case 'home': $page = HomePage::getInstance($path, $params); break; case 'register': $page = RegistrationPage::getInstance($path, $params); break; case 'login': $page = LoginPage::getInstance($path, $params); break; case 'logout': $page = LogoutPage::getInstance($path, $params); break; case 'switch-user': $page = SwitchUserPage::getInstance($path, $params); break; case 'links': $page = LinksPage::getInstance($path, $params); break; case 'users': $page = UsersPage::getInstance($path, $params); break; case 'groups': $page = GroupsPage::getInstance($path, $params); break; case 'settings': $page = SettingsPage::getInstance($path, $params); break; case 'tools': $page = ToolsPage::getInstance($path, $params); break; case 'installation': $page = InstallationPage::getInstance($path, $params); break; default: $page = NotFoundPage::getInstance($path, $params); } return $page; }
public function handleExpiredMembers($expiredMembers) { $register = RegistrationPage::get_one('RegistrationPage'); $count = 0; if ($expiredMembers->Count() > 0) { foreach ($expiredMembers as $member) { $member->MembershipStatus = 'Expired'; try { $email = new MemberExpiredEmail($register, $member); $email->send(); $member->write(); $count++; echo '<p>Email sent to:' . $member->Email . ' </p>'; } catch (ValidationException $e) { echo '<p>Failed to update record: ' . $member->FirstName . '</p>'; } } } echo '<p>' . $count . ' members notified of expired membership</p>'; return $expiredMembers; }
public function getContactRegistrationForm() { $registrants = RegistrationPage::paginate(25); $allRegistrants = RegistrationPage::all(); return View::make('admin.contact-teams', array('registrants' => $registrants, 'allRegistrants' => $allRegistrants)); }
public function testUserRegistrationAndActivation(WebGuy $I, $scenario) { $I->wantTo('Check registration and activation new user account...'); $I->amOnPage(\RegistrationPage::URL); $I->see(\RegistrationPage::$buttonLabel); $I->seeInTitle('Регистрация'); $I->wantTo('See form with empty fields...'); $I->seeInField(\RegistrationPage::$nickNameField, ''); $I->seeInField(\RegistrationPage::$emailField, ''); $I->seeInField(\RegistrationPage::$passwordField, ''); $I->seeInField(\RegistrationPage::$cpasswordField, ''); $I->see(\RegistrationPage::$buttonLabel); $I->wantTo('Test form validation...'); $testNickName = 'testuser'; $testEMail = '*****@*****.**'; $testPassword = '******'; $I->fillField(\RegistrationPage::$nickNameField, 'test-nick.name'); $I->fillField(\RegistrationPage::$emailField, 'test'); $I->fillField(\RegistrationPage::$passwordField, $testPassword); $I->fillField(\RegistrationPage::$cpasswordField, '111'); $I->click(\RegistrationPage::$buttonLabel, '.btn-primary'); $I->see('Email не является правильным E-Mail адресом', \CommonPage::ERROR_CSS_CLASS); $I->see('Пароли не совпадают', \CommonPage::ERROR_CSS_CLASS); $I->see('Неверный формат поля "Имя пользователя" допустимы только буквы и цифры, от 2 до 20 символов', \CommonPage::ERROR_CSS_CLASS); $I->wantTo('Test form with existing user name and email...'); $I->fillField(\RegistrationPage::$nickNameField, 'yupe'); $I->fillField(\RegistrationPage::$emailField, '*****@*****.**'); $I->fillField(\RegistrationPage::$passwordField, $testPassword); $I->fillField(\RegistrationPage::$cpasswordField, $testPassword); $I->click(\RegistrationPage::$buttonLabel, '.btn-primary'); $I->see('Имя пользователя уже занято', \CommonPage::ERROR_CSS_CLASS); $I->see('Email уже занят', \CommonPage::ERROR_CSS_CLASS); $I->wantTo('Test success registration...'); $I->fillField(\RegistrationPage::$nickNameField, $testNickName); $I->fillField(\RegistrationPage::$emailField, $testEMail); $I->click(\RegistrationPage::$buttonLabel, '.btn-primary'); $I->see('Учетная запись создана! Проверьте Вашу почту!', \CommonPage::SUCCESS_CSS_CLASS); $I->seeInCurrentUrl('login'); // check that user is created $I->seeInDatabase('yupe_user_user', ['email' => $testEMail, 'access_level' => 0, 'status' => 2, 'email_confirm' => 0, 'nick_name' => $testNickName]); //check that token is created $I->seeInDatabase('yupe_user_tokens', ['user_id' => 2, 'type' => 1, 'status' => 0]); $I->wantTo('Test that new user cant login without account activation...'); $I->fillField(\LoginPage::$emailField, $testEMail); $I->fillField(\LoginPage::$passwordField, $testPassword); $I->click(\CommonPage::LOGIN_LABEL, \CommonPage::BTN_PRIMARY_CSS_CLASS); $I->see('Email или пароль введены неверно!', \CommonPage::ERROR_CSS_CLASS); $I->wantTo('Test account activation...'); $key = $I->grabFromDatabase('yupe_user_tokens', 'token', ['user_id' => 2, 'type' => 1, 'status' => 0]); $I->amOnPage(\RegistrationPage::getActivateRoute(time())); $I->see('Внимание! Возникла проблема с активацией аккаунта. Обратитесь к администрации сайта.', \CommonPage::ERROR_CSS_CLASS); $I->seeInCurrentUrl('registration'); $I->amOnPage(\RegistrationPage::getActivateRoute($key)); $I->see('Вы успешно активировали аккаунт! Теперь Вы можете войти!', \CommonPage::SUCCESS_CSS_CLASS); // check user $I->seeInDatabase('yupe_user_user', ['email' => $testEMail, 'access_level' => 0, 'status' => 1, 'email_confirm' => 1, 'nick_name' => $testNickName]); //check token $I->dontSeeInDatabase('yupe_user_tokens', ['user_id' => 2, 'type' => 1, 'status' => 0]); $I->wantTo('Test login with new account...'); $I = new WebGuy\UserSteps($scenario); $I->login($testEMail, $testPassword); $I->dontSeeLink('Панель управления'); }
Route::get('/dashboard/press/{id?}', array('as' => 'dashboard.press.get', 'uses' => 'DashboardController@getPressPage')); Route::post('/dashboard/press/{id?}', array('as' => 'dashboard.press.post', 'uses' => 'DashboardController@postPressPage')); Route::get('/dashboard/terrace/{id?}', array('as' => 'dashboard.terrace.get', 'uses' => 'DashboardController@getTerracePage')); Route::post('/dashboard/terrace/{id?}', array('as' => 'dashboard.terrace.post', 'uses' => 'DashboardController@postTerracePage')); Route::get('/dashboard/contact-registration', array('as' => 'dashboard.contact.registration.form.get', 'uses' => 'DashboardController@getContactRegistrationForm')); Route::post('/dashboard/delete-residences-image/{id}', array('as' => 'dashboard.residences.delete.image.post', 'uses' => 'DashboardController@deleteResidencesImage')); Route::post('/dashboard/delete-amenities-image/{id}', array('as' => 'dashboard.amenities.delete.image.post', 'uses' => 'DashboardController@deleteAmenitiesImage')); Route::post('/dashboard/delete-availability-image/{id}', array('as' => 'dashboard.availability.delete.image.post', 'uses' => 'DashboardController@deleteAvailabilityImage')); Route::post('/dashboard/delete-availability-default-image/{id}', array('as' => 'dashboard.availability.default.delete.image.post', 'uses' => 'DashboardController@deleteAvailabilityPageImage')); Route::post('/dashboard/delete-dutch-kills-image/{id}', array('as' => 'dashboard.dutch.kills.delete.image.post', 'uses' => 'DashboardController@deleteDutchKillsImage')); Route::post('/dashboard/change-availability-object-state/{id}', array('as' => 'dashboard.availability.change.state.post', 'uses' => 'DashboardController@changeAvailabilityObjectState')); Route::post('/dashboard/upload-image', array('as' => 'dashboard.upload.image.post', 'uses' => 'DashboardController@uploadImage')); Route::post('/dashboard/reorder/{type}', array('as' => 'dashboard.reorder.post', 'uses' => 'DashboardController@updateSortableElements')); Route::get('/logout', array('as' => 'logout.get', 'uses' => 'AuthController@getLogout')); Route::get('/xls', array('as' => 'xls', 'uses' => function () { Excel::create('Excel_export', function ($excel) { $excel->sheet('Registrants', function ($sheet) { $registrants = RegistrationPage::all(); $sheet->loadView('admin.xls', ['registrants' => $registrants->toArray()]); }); })->export('xls'); })); Route::get('/csv', array('as' => 'csv', 'uses' => function () { Excel::create('Csv_export', function ($excel) { $excel->sheet('Registrants', function ($sheet) { $registrants = RegistrationPage::all(); $sheet->loadView('admin.xls', ['registrants' => $registrants->toArray()]); }); })->export('csv'); })); });
<?php /** Copyright 2011-2015 Nick Korbel This file is part of Booked Scheduler. Booked Scheduler is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Booked Scheduler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Booked Scheduler. If not, see <http://www.gnu.org/licenses/>. */ define('ROOT_DIR', '../'); require_once ROOT_DIR . 'Pages/RegistrationPage.php'; $page = new RegistrationPage(); $page->PageLoad();
continue; } if (isset($rp->reg_user)) { $obj->array_of_errors = @$rp->reg_user->array_of_errors; } } break; case 'right': $obj->mode = PRI; if ($moduleName != 'AdsByGoogleModule') { $obj->block_type = HOMEPAGE; } break; } } $rp = new RegistrationPage(); try { $rp->main(); $msg = !empty($rp->reg_user->msg) ? nl2br($rp->reg_user->msg) : @$rp->inv_error; } catch (PAException $e) { $msg = $e->getMessage(); } $page = new PageRenderer("setup_module", PAGE_REGISTER, "Registration Page", "container_three_column.tpl", "header.tpl", PUB, HOMEPAGE, PA::$network_info); // added by Zoran Hron: JQuery validation & AJAX file upload -- $page->add_header_html(js_includes('jquery.validate.js')); $page->add_header_html(js_includes('jquery.metadata.js')); $page->add_header_html(js_includes('ajaxfileupload.js')); $page->add_header_html(js_includes('user_registration.js')); uihelper_error_msg($msg); uihelper_get_network_style(); $page->html_body_attributes = ' id="registration_page"';
/** * @return Form */ public function Form() { // Attempt to retrieve a current registration for the logged in member $reg = $this->getCurrentRegistration(); $register = RegistrationPage::get()->First(); // If the user has no registration, redirect them to the registration page if (!$reg) { if ($register) { return $this->redirect($register->AbsoluteLink()); } else { return $this->redirect($this->baseURL); } } if (!$this->userGameRegOpen()) { return false; } // If the user has already added games, redirect them to after submission // @todo: allow users to edit submitted game choices if ($reg->PlayerGames()->Count() > 0) { return $this->redirect($this->Link('yourgames')); } $fields = $this->GameSignupFields($reg); $form = new Form($this, 'Form', $fields, new FieldList(new FormAction('addplayergames', 'Submit'))); $form->enableSpamProtection(); $form->addExtraClass('preference-select'); return $form; }