/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $user = new User(); $member = new Member(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['User'], $_POST['Member'])) { $user->attributes = $_POST['User']; $user->repeat_password = $_POST['User']['repeat_password']; $member->attributes = $_POST['Member']; $member->type_account = $_POST['Member']['type_account']; $user->scenario = 'register'; $member->scenario = 'register'; $user->level = 3; $valid = $user->validate(); $valid = $member->validate() && $valid; if ($valid) { $email = explode("@", $user->username); $member->name = $email[0]; $member->email = $user->username; $member->date_register = new CDbExpression('NOW()'); $member->code = strtoupper(substr(md5(uniqid(rand(), true)), 0, 5)); $getToken = rand(0, 99999); $getTime = date("H:i:s"); $user->token = md5($getToken . $getTime); $user->save(); $member->save(); MemberController::SendMail($member->email, $member->name, $member->code, $user->token); echo CJSON::encode(array('reg' => 'success', 'redirect' => $this->createUrl(array('land/userme')), 'email' => $member->email)); } else { echo CJSON::encode(array('reg' => 'failed', 'email' => str_replace('Username', 'Email', CHtml::error($user, 'username')), 'username' => str_replace('Name', 'Username', CHtml::error($member, 'name')), 'password' => CHtml::error($user, 'password'), 'repeat_password' => CHtml::error($user, 'repeat_password'), 'all' => Chtml::errorSummary(array($user, $member)))); } } }
public function run() { // セッション開始 認証に利用します。 $this->auth = new Auth(); $this->auth->set_authname(_SYSTEM_AUTHINFO); $this->auth->set_sessname(_SYSTEM_SESSNAME); $this->auth->start(); if (!$this->auth->check() && $this->type != 'authenticate') { // 未認証 $this->type = 'login'; } // 共用のテンプレートなどをこのフラグで管理用に切り替えます。 $this->is_system = true; // 会員側の画面を表示するためMemberControllerを利用します。 $MemberController = new MemberController($this->is_system); switch ($this->type) { case "login": $this->screen_login(); break; case "logout": $this->auth->logout(); $this->screen_login(); break; case "modify": $MemberController->screen_modify($this->auth); break; case "delete": $MemberController->screen_delete(); break; case "list": $this->screen_list(); break; case "regist": $MemberController->screen_regist($this->auth); break; case "notice": $NoticeController = new NoticeController(); $NoticeController->screen_modify(); break; case "authenticate": $this->do_authenticate(); break; default: $this->screen_top(); } }
protected function beforeAction($event) { $role = Yii::app()->user->role_id; if ($role != ROLE_LANDLORD) { switch ($role) { case ROLE_REGISTER_MEMBER: $this->redirect(Yii::app()->createAbsoluteUrl('member/member_profile/myprofile')); break; case ROLE_TENANT: $this->redirect(Yii::app()->createAbsoluteUrl('member/tenant/property')); break; case ROLE_AGENT: $this->redirect(Yii::app()->createAbsoluteUrl('member/dashboard')); break; } } return parent::beforeAction($event); }
public function beforeAction($action) { if (parent::beforeAction($action)) { $group = Yii::app()->session['group']; $userInfo = Yii::app()->session['userInfo']; // if (strpos($group[$userInfo['groupId']]->action, Yii::app()->controller->id) || strpos($group[$userInfo['groupId']]->action, $action->id) === false) { // ShowMessage::error('无权限使用此功能,请升级你的账号!'); // } $paramId = intval(Yii::app()->request->getParam('wechatId', 0)); $wechatId = $paramId ? $paramId : Yii::app()->session['wechatId']; if ($paramId) { Yii::app()->session['wechatId'] = $paramId; } $this->wechatInfo = $this->_getWechatInfo($wechatId); Yii::app()->session['isAuth'] = $this->wechatInfo->isAuth; } return true; }
protected function beforeAction($event) { $role = Yii::app()->user->role_id; $aActionNotCheck = array('delete'); $cAction = Yii::app()->controller->action->id; if ($role != ROLE_TENANT && !in_array($cAction, $aActionNotCheck)) { switch ($role) { case ROLE_REGISTER_MEMBER: $this->redirect(Yii::app()->createAbsoluteUrl('member/member_profile/myprofile')); break; case ROLE_LANDLORD: $this->redirect(Yii::app()->createAbsoluteUrl('member/landlord/property')); break; case ROLE_AGENT: $this->redirect(Yii::app()->createAbsoluteUrl('member/dashboard')); break; } } return parent::beforeAction($event); }
public function view($user_id = NULL) { if ($user_id == NULL) { $user = unserialize($this->session->userdata('user_obj')); } else { if (is_numeric($user_id)) { $user = User::getUserById($user_id); if ($user == NULL) { parent::show404Error(); } //On change la vue du menu parent::setMenuView('menu/profils_menu'); } else { parent::show404Error(); } } parent::loadHeader(); $data = array(); $data['user'] = $user; $this->load->view('profil/index', $data); parent::loadFooter(); }
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%band_search_dao.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%band_genre_dao.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%band_member_dao.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%band.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%band_member.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%search_results.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "objects%search_parameters.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "utilities%search_utilities.php"); $bandSkeletons = null; $dbConnection = null; $memberID = null; try { $dbConnection = DatabaseUtilities::getDatabaseConnection(); //Get the current user's ID and details. $memberID = LoginController::getLoggedInMemberID(); if ($memberID != null) { $inputMemberID = $_POST[MemberEditConstants::MEMBER_ID_INPUT]; if (MemberController::processMemberViewSecurityCheck($inputMemberID, $_POST[MemberEditConstants::ENCRYPTED_ID_INPUT])) { //TODO: Add paging functions. $bandSearchResults = BandSearchController::searchBandsByMemberID($inputMemberID, 1, 10, $dbConnection); //If member details cannot be obtained, error if ($bandSearchResults != null) { $bandSkeletons = $bandSearchResults->getVariable(SearchResults::SKELETONS); } } } } catch (Exception $ex) { $bandSkeletons = null; } $dbConnection = null; require_once $config->getIncludeURL(Config::INCLUDES_PATH, "views%musicians%musician_bands_view.php");
require_once "config.php"; require_once $config->getIncludeURL(Config::INCLUDES_PATH, "common_includes.php.inc"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%member_instrument_dao.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "constants%member_edit_constants.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "controllers%member_controller.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "controllers%member_instrument_controller.php"); $dbConnection = null; $memberID = null; $processed = false; try { $dbConnection = DatabaseUtilities::getDatabaseConnection(); $memberID = LoginController::getLoggedInMemberID($dbConnection); if ($memberID != null) { $inputMemberID = $_POST[MemberEditConstants::MEMBER_ID_INPUT]; $encryptedID = $_POST[MemberEditConstants::ENCRYPTED_ID_INPUT]; if (MemberController::processMemberSecurityCheck($memberID, $inputMemberID, $encryptedID)) { if (isset($_POST['actionID']) && isset($_POST[MemberEditConstants::INSTRUMENT_INPUT_ID])) { //TODO: Needs to be encrypted. $actionID = $_POST['actionID']; $instrumentID = $_POST[MemberEditConstants::INSTRUMENT_INPUT_ID]; if ($actionID == 3) { $processed = MemberInstrumentController::deleteMemberInstrument($memberID, $instrumentID, $dbConnection); } else { if (isset($_POST[MemberEditConstants::EXPERIENCE_INPUT_ID]) && isset($_POST[MemberEditConstants::INSTRUMENT_STYLE_INPUT_ID])) { $experienceID = $_POST[MemberEditConstants::EXPERIENCE_INPUT_ID]; $styleIDs = $_POST[MemberEditConstants::INSTRUMENT_STYLE_INPUT_ID]; $styleIDs = split("-", $styleIDs); switch ($actionID) { case 1: $processed = MemberInstrumentController::addMemberInstrument($memberID, $instrumentID, $experienceID, $styleIDs, $dbConnection); break;
private function list_members($request) { $service = $request['srv']; $start = !empty($request['args']['start']) ? $request['args']['start'] : 0; $limit = !empty($request['args']['limit']) ? $request['args']['limit'] : null; $name = !empty($request['args']['name']) ? $request['args']['name'] : ""; $members = array(); $type = ObjectTypes::instance()->findByName($service); $typeId = $type->getId(); if ($service == "workspace") { $dimension_id = Dimensions::findByCode('workspaces')->getId(); } else { $dimension_id = Dimensions::findByCode('customer_project')->getId(); } $limit_obj = array('offset' => $start, 'limit' => $limit); $extra_conditions = null; if ($name != "") { $extra_conditions = "AND name LIKE '%" . $name . "%'"; } $params = array('dim_id' => $dimension_id, 'type_id' => $typeId, 'start' => $start, 'limit' => $limit); $memberController = new MemberController(); $object = $memberController->list_all($params); foreach ($object["members"] as $m) { $member = Members::getMemberById($m['id']); $memberInfo = array('id' => $m['id'], 'name' => $m['name'], 'type' => $service, 'path' => $member->getPath()); $members[] = $memberInfo; } return $this->response('json', $members); }
$memberID = null; $processed = false; $submissionKey = null; $error = false; $errorCode = 0; try { $dbConnection = DatabaseUtilities::getDatabaseConnection(); //Get the current user's ID and details. $memberID = LoginController::getLoggedInMemberID($dbConnection); if ($memberID == null) { header("Location: login.php"); exit; } else { if (isset($_GET['advertisementID'])) { $advertisementID = $_GET['advertisementID']; $memberDetails = MemberController::getMemberDetails($memberID, $dbConnection); //If member details or advertisement ID cannot be obtained then do not continue. if ($memberDetails != null && $advertisementID != null) { //Check that the user has the priviledge to edit the advertisement. $advertisementDetails = AdvertisementController::getAdvertisementForEdit($advertisementID, $memberID, $dbConnection); //If the advertisementDetails object is null then the user does not have the permissions to edit it. if ($advertisementDetails != null) { $advertisementGenres = AdvertisementGenreController::getAdvertisementGenres($advertisementID, $dbConnection); $advertisementPositions = AdvertisementPositiionController::getAdvertisementPositions($advertisementID, $dbConnection); //Encrypt values to be validated on update. $advertisementKey = EncryptionUtilities::encryptString($advertisementID . $memberID); $memberIDEncrypted = EncryptionUtilities::encryptString($memberID); //Generate a submission key to be used upon update. $submissionKey = MemberSubmissionController::generateSubmissionKey($memberID, $dbConnection); $processed = true; }
require_once $config->getIncludeURL(Config::INCLUDES_PATH, "controllers%member_controller.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "controllers%member_genre_controller.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "controllers%member_purpose_controller.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%member_purpose_dao.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "daos%member_genre_dao.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "constants%member_edit_constants.php"); require_once $config->getIncludeURL(Config::INCLUDES_PATH, "utilities%change_utilities.php"); $dbConnection = DatabaseUtilities::getDatabaseConnection(); $memberID = LoginController::getLoggedInMemberID($dbConnection); $processed = false; if ($memberID != null) { $inputMemberID = $_POST[MemberEditConstants::MEMBER_ID_INPUT]; $encryptedID = $_POST[MemberEditConstants::ENCRYPTED_ID_INPUT]; if (MemberController::processMemberSecurityCheck($memberID, $inputMemberID, $encryptedID)) { $changeKey = $_POST[MemberEditConstants::CHANGED_INPUT_ID]; MemberController::updateMusicianProfile($memberID, $changeKey, $_POST[MemberEditConstants::AGE_RANGE_INPUT_ID], $_POST[MemberEditConstants::GENDER_INPUT_ID], $_POST[MemberEditConstants::MUSIC_INPUT_ID], $_POST[LocationConstants::CHANGE_KEY_INPUT], $_POST[LocationConstants::LOCATION_COUNTRY_INPUT_ID], $_POST[LocationConstants::LOCATION_STATE_INPUT_ID], $_POST[LocationConstants::LOCATION_CITY_INPUT_ID], $_POST[LocationConstants::LOCATION_REGION_INPUT_ID], $dbConnection); MemberGenreController::updateMemberGenres($memberID, $changeKey, $_POST[MemberEditConstants::GENRE_INPUT_ID], $dbConnection); $purposes = null; if (isset($_POST[MemberEditConstants::NEW_BAND_INPUT_ID])) { $purposes[] = 1; } if (isset($_POST[MemberEditConstants::JOIN_BAND_INPUT_ID])) { $purposes[] = 2; } if (isset($_POST[MemberEditConstants::JAMMING_INPUT_ID])) { $purposes[] = 3; } MemberPurposeController::updateMemberPurposes($memberID, $changeKey, $purposes, $dbConnection); $processed = true; } }
if ($memberID != null) { $inputMemberID = $_POST[MemberEditConstants::MEMBER_ID_INPUT]; $encryptedID = $_POST[MemberEditConstants::ENCRYPTED_ID_INPUT]; if (MemberController::processMemberSecurityCheck($memberID, $inputMemberID, $encryptedID)) { AdvertisementController::deactivateMemberAdvertisements($memberID, $dbConnection); $bandSearchResults = BandSearchController::searchBandsByMemberID($memberID, 1, 100, $dbConnection); if ($bandSearchResults != null) { $bandSkeletons = $bandSearchResults->getVariable(SearchResults::SKELETONS); if ($bandSkeletons != null) { foreach ($bandSkeletons as $bandSkeleton) { $bandID = $bandSkeleton->getVariable(Band::BAND_ID); $bandMembers = BandMemberDao::selectBandMembers($bandID, $dbConnection); if (count($bandMembers) == 1) { BandController::deactivateBand($memberID, $bandID, $dbConnection); } } } } MemberController::deactivateMusicianProfile($memberID, $dbConnection); $processed = true; } } } catch (Exception $ex) { $processed = false; } $dbConnection = null; if (!$processed) { ErrorUtilities::errorRedirect(ErrorConstants::GENERAL_ERROR); } else { header("Location: " . $config->getVariable(Config::WEB_ROOT_PATH)); }
<?php /************************************************* * 会員実行スクリプト * */ define('_ROOT_DIR', __DIR__ . '/'); require_once _ROOT_DIR . '../php_lib/init.php'; $controller = new MemberController(); $controller->run(); exit; ?>
/** * Page de recherche */ public function search($str = '') { parent::loadHeader(); $str_to_search = NULL; if (!empty($str)) { $str_to_search = urldecode(trim(htmlspecialchars($str))); } else { // Pour valider form $this->load->library('form_validation'); $this->load->helper('form'); $this->form_validation->set_error_delimiters('<div class="alert alert-error"><button type="button" class="close" data-dismiss="alert">×</button>', '</div>'); //mise en place des regles $this->form_validation->set_rules('search_query', 'recherche', 'required|encode_php_tags|htmlspecialchars|trim|xss_clean|max_length[200]'); if ($this->form_validation->run() != FALSE) { $str_to_search = $this->input->post('search_query'); } } // Requête SQL de recherche if ($str_to_search == NULL) { $this->index(); } else { $files = File::search($str_to_search); //Fabriquer tableau $data['files'] = $files; $data['query'] = $str_to_search; $this->load->view('flux/flux_search', $data); } parent::loadFooter(); }
public function run() { $this->auth = new Auth(); $this->auth->set_authname(_SYSTEM_AUTHINFO); $this->auth->set_sessname(_SYSTEM_SESSNAME); $this->auth->start(); //ログイン状態になく、かつ typeがauthenticate でない if (!$this->auth->check_system() && $this->type != 'authenticate') { $this->type = 'login'; } $this->is_system = true; $MemberController = new MemberController($this->is_system); $MemberMyPageController = new MemberMyPageController($this->is_system); $CustomerController = new CustomerController($this->is_system); switch ($this->type) { //認証 case "authenticate": $this->do_authenticate(); break; //ログイン //ログイン case "login": $this->screen_login(); break; //ログアウト //ログアウト case "logout": $this->auth->logout(); $this->screen_login(); break; //・・・・・・・member・・・・・・・・・・・・・・・・・ //登録会員の一覧 //・・・・・・・member・・・・・・・・・・・・・・・・・ //登録会員の一覧 case "member_list": $this->screen_member_list(); break; //会員情報の詳細 //会員情報の詳細 case "member_detail": $MemberMyPageController->screen_member_modify($this->auth); break; //新規会員の発行 //新規会員の発行 case "regist": $MemberController->screen_regist($this->auth); break; //新規会員の追加情報の登録 //新規会員の追加情報の登録 case "regist_add": $MemberController->screen_regist_add($this->auth); break; //会員情報の更新・削除の振り分け //会員情報の更新・削除の振り分け case "modify_or_delete": $this->screen_member_modify_or_delete(); break; //会員情報の更新 //会員情報の更新 case "modify": $MemberMyPageController->screen_member_modify($this->auth); break; //会員情報の削除 //会員情報の削除 case "delete": $MemberMyPageController->screen_delete(); break; //・・・・・・・・customer・・・・・・・・・・・・・・・・・・ //顧客の一覧 //・・・・・・・・customer・・・・・・・・・・・・・・・・・・ //顧客の一覧 case "customer_list": $this->screen_customer_list(); break; //新規顧客の発行 //新規顧客の発行 case "customer_regist": $this->screen_customer_regist(); break; //顧客情報の詳細 //顧客情報の詳細 case "customer_detail": $CustomerController->screen_company($this->auth); break; //顧客情報の更新・削除の振り分け //顧客情報の更新・削除の振り分け case "modify_or_delete_customer": $this->screen_customer_modify_or_delete(); break; //顧客情報の更新 //顧客情報の更新 case "company": $CustomerController->screen_company($this->auth); break; //顧客情報の削除 //顧客情報の削除 case "delete_customer": $this->screen_customer_delete(); break; //・・・・・・・・customerの案件・・・・・・・・・・・・・・・・・ //案件一覧 ok //・・・・・・・・customerの案件・・・・・・・・・・・・・・・・・ //案件一覧 ok case "list_project": $CustomerController->screen_list_project(); break; //案件登録 //案件登録 case "regist_project": $CustomerController->screen_regist_project(); break; //更新・削除、動作定義 //更新・削除、動作定義 case "modify_or_delete_project": $CustomerController->screen_modify_or_delete_project(); break; //案件更新 //案件更新 case "modify_project": $CustomerController->screen_modify_project(); break; //案件削除 //案件削除 case "delete_project": $CustomerController->screen_delete_project(); break; //案件の詳細 顧客一覧より使用 //案件の詳細 顧客一覧より使用 case "detail_project": $MemberController->screen_detail_project(); break; //・・・・・・・・メッセージ・・・・・・・・・・・・・・・・・・・・・・・・ //メッセージ //・・・・・・・・メッセージ・・・・・・・・・・・・・・・・・・・・・・・・ //メッセージ case "message_box": $this->screen_message_box(); break; //メールの詳細を確認 //メールの詳細を確認 case "detail_message": $this->screen_detail_message(); break; //・・・・・・・・応募履歴・・・・・・・・・・・・・・・・・・・・・・・・・ //応募者一覧 //・・・・・・・・応募履歴・・・・・・・・・・・・・・・・・・・・・・・・・ //応募者一覧 case "applicant_list": $this->screen_applicant_list(); break; //・・・・・・・トップ画面・・・・・・・・・・・・・・・・・・・・・・・・・ //・・・・・・・トップ画面・・・・・・・・・・・・・・・・・・・・・・・・・ default: $this->screen_top(); } }
public function init() { parent::init(); $this->userID = Yii::app()->user->id; // $this->userID = 204; }
public function settings() { parent::loadHeader(); $user = unserialize($this->session->userdata('user_obj')); $data = array(); $data['user'] = $user; $this->load->view('notification_zone'); $this->load->view('account/change_settings', $data); parent::loadFooter(); }
} if ($emailAddress == null) { echo "Email Address is null"; $validInputs = false; } if ($passwordReenter == null) { echo "Password repeat is null"; $validInputs = false; } if ($password == null) { echo "Password is null"; $validInputs = false; } if ($validInputs) { echo "All inputs valid<br/>"; $memberID = MemberController::createMemberAccount($firstName, $lastName, $emailAddress, $password, $gender, $ageRange, $locationCountry, $locationState, $locationCity, $locationRegion, $dbConnection); echo "Member ID {$memberID}<br/>"; if ($memberID != -1) { echo "Attempting login<br/>"; echo LoginController::login($emailAddress, $password, $dbConnection); } echo "<br/>"; echo "Logged in member ID: " . LoginController::getLoggedInMemberID() . "<br/>"; echo "end"; } // if ($memberID != null) // { // $inputMemberID = $_POST[MemberEditConstants::MEMBER_ID_INPUT]; // $encryptedID = $_POST[MemberEditConstants::ENCRYPTED_ID_INPUT]; // if (MemberController::processMemberSecurityCheck($memberID, $inputMemberID, $encryptedID)) // {