本文整理汇总了PHP中Member::getID方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::getID方法的具体用法?PHP Member::getID怎么用?PHP Member::getID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Member
的用法示例。
在下文中一共展示了Member::getID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signinAction
public function signinAction()
{
// use members : signin
if (isset($_POST['email']) && isset($_POST['password'])) {
$signInOkay = Members::signIn($_POST['email'], $_POST['password']);
if ($signInOkay == TRUE) {
$connectedMember = new Member($_POST['email']);
$_SESSION['connected'] = TRUE;
$_SESSION['email'] = $connectedMember->getEmail();
$_SESSION['isAdmin'] = $connectedMember->isAdmin();
$_SESSION['idMember'] = $connectedMember->getID();
$_SESSION['firstname'] = $connectedMember->getFirstname();
$_SESSION['lastname'] = $connectedMember->getLastname();
unset($_POST);
$this->redirect('/profile/edit');
} else {
$_SESSION['connected'] = FALSE;
$this->msgfailed = "Connection Failed";
}
}
$tableau = array();
$tableau[0] = 'none';
$tableau[1] = 'none';
$tableau[2] = 'none';
$tableau[3] = 'none';
$this->activeBar = $tableau;
}
示例2: getFriends
if ($id!=$_SESSION['member_id']){
$my_friends = getFriends($_SESSION['member_id']);
$mutual_friends = array_intersect($friends, $my_friends);
} else {
$mutual_friends = array();
}
// Get activities
$act_obj = new Activity();
$activities = $act_obj->getActivities($id);
// Member object
$profile = new Member($id);
// Tracks
if ($profile->getID() != $_SESSION['member_id']){
$profile->addVisitor($_SESSION['member_id']);
}
// Privacy Controller
$pc = new PrivacyController();
$privacy_obj = $pc->getPrivacyObject($id);
if ($privacy_obj==null){
//no such person
//add error and redirect back to is own page?
// header('Location: sprofile.php');
// exit;
} else {
$relationship = $pc->getRelationship($id);
$profile_prefs = $privacy_obj->getProfile();
}
示例3: execute
function execute()
{
$return = new stdClass();
$params = Request::_REQUEST();
Config::set("HideDebugger", true);
if (isset($params["id"])) {
$user = new Member($params["id"]);
if (isset($user) && $user->isValid()) {
if ($params["passwd"] != "") {
$user->setPassword($params["passwd"]);
}
$user->setLevel($params["level"]);
$user->setIsEnabled($params["is_enabled"]);
$user->setUserFirstname($params["userFirstname"]);
$user->setUserLastname($params["userLastname"]);
$user->setUserEmail($params["useremail"]);
$user->setUserBio($params["userBio"]);
$user->setWeb($params["web"]);
$user->setUserCompany($params["userCompany"]);
$user->setUserCompanyType($params["userCompanyType"]);
$user->setUserAddr1($params["userAddr1"]);
$user->setUserAddr2($params["userAddr2"]);
$user->setUserCity($params["userCity"]);
$user->setUserState($params["userState"]);
$user->setUserCountry($params["userCountry"]);
$user->setUserZip($params["userZip"]);
$user->setUserPhone($params["userPhone"]);
$user->setUserAltPhone($params["userAltPhone"]);
$user->setUserFax($params["userFax"]);
$user->setSiteAreas($params["siteAreas"]);
$user->setUpdates($params["updates"]);
$user->setPaymentType($params["paymentType"]);
$user->setPaymentTypeDetails($params["paymentTypeDetails"]);
$user->setShipAddr1($params["shipAddr1"]);
$user->setShipAddr2($params["shipAddr2"]);
$user->setShipCity($params["shipCity"]);
$user->setShipState($params["shipState"]);
$user->setShipCountry($params["shipCountry"]);
$user->setShipZip($params["shipZip"]);
if ($user->save()) {
// encrypt any credit card information then set the CC field
// check for an existing private key first
$existing_privateKey = CryptKey::findCryptKeyByUserID($user->getID());
$cc_privateKey = null;
if (isset($existing_privateKey) && $existing_privateKey->isValid()) {
// retrieve existing key
Debugger::log("User crypt private key: " . $existing_privateKey->getKey());
$cc_privateKey = $existing_privateKey->getKey();
} else {
// store key into keys table
$user_key = new CryptKey();
$user_key->setUserID($user->getID());
$user_key->setKey(TwoWayEncryption::genPrivateKey());
if ($user_key->save()) {
Debugger::log("Saved user crypt private key.");
$cc_privateKey = $user_key->getKey();
} else {
Debugger::log("Saving user crypt private key failed! Refusing to encrypt contents!");
}
}
if (!is_null($cc_privateKey)) {
$cc_data = unserialize(TwoWayEncryption::decrypt($user->getCC(), $cc_privateKey));
$cc_data = array_merge($cc_data, array("name" => $params["ccc_name"], "ccNum" => $params["ccc_ccNum"], "MM" => $params["ccc_MM"], "YY" => $params["ccc_YY"], "ccCODE" => $params["ccc_ccCode"]));
$cc_encrypted_data = TwoWayEncryption::encrypt(serialize($cc_data), $cc_privateKey);
$user->setCC($cc_encrypted_data);
$user->save();
}
$return->id = $user->getID();
$return->updated = true;
echo json_encode($return);
return;
} else {
$error = DatabaseFactory::passinggreen_db()->getLastError();
$return->error = "could not update Member object because: " . $error;
echo json_encode($return);
return;
}
} else {
$return->error = "ID is invalid!";
echo json_encode($return);
return;
}
} else {
$return->error = "Missing ID!";
echo json_encode($return);
return;
}
}
示例4: regist
public function regist()
{
}
// 登録完了メールの送信
public function registMail()
{
}
// 会員情報の編集
public function edit()
{
}
// パスワードの再発行
public function resendPassword()
{
}
// 退会処理
public function delete()
{
}
}
$member = new Member();
$member->setID("1");
$member->setLastname('あなたの姓');
$member->setFirstname('あなたの名');
$member->setEmail('あなたのメールアドレス');
$member->setPassword('パスワード');
print $member->getID() . "<BR>";
print $member->getLastname() . "<BR>";
print $member->getFirstname() . "<BR>";
print $member->getEmail() . "<BR>";
print $member->getPassword() . "<BR>";
示例5: memberFilter
public static function memberFilter(Member $member)
{
return array("column" => self::$MEMBER_ID, "value" => $member->getID());
}
示例6: execute
function execute()
{
$return = new stdClass();
$params = Request::_REQUEST();
Config::set("HideDebugger", true);
//comment this out to debug
if (isset($params["id"])) {
$user = new Member($params["id"]);
if (isset($user) && $user->isValid()) {
// retrieve account balance based on transactions
$user_balance = 0.0;
$user_commission = 0.0;
/* $Referral_Join = DBObject::collection("Referral");
$Member_Join = DBObject::collection("Member");
$Member_Vendor_Join = DBObject::collection("Member");
$Transactions = DBObject::collection("Transaction")
->applyJoin("LEFT OUTER", $Referral_Join, array("ReferralID", "AutoID"))
->applyJoin("LEFT OUTER", $Member_Join, array("UserID", "AutoID"))
->applyJoin("LEFT OUTER", $Member_Vendor_Join, array("VendorID", "AutoID"))
->applyUserIDFilter($user->getID());
Debugger::log(Var_Dump::display($Transactions->getTransactions(), true));
*/
$q = "SELECT\n\t\t\t\tt.`amount`,\n\t\t\t\tr.*,\n\t\t\t\tCONCAT(user.`userFirstname`, CONCAT(' ',user.`userLastname`)) as _from,\n\t\t\t\tCONCAT(vendor.`userFirstname`, CONCAT(' ',vendor.`userLastname`)) as _to\n\t\t\tFROM `transactions` t\n\n\t\t\tLEFT OUTER JOIN `referrals` r\n\t\t\t\tON (t.`ReferralID` = r.`AutoID`)\n\n\t\t\tLEFT OUTER JOIN `user_signup` user\n\t\t\t\tON (r.`UserID` = user.`AutoID`)\n\n\t\t\tLEFT OUTER JOIN `user_signup` vendor\n\t\t\t\tON (r.`VendorID` = vendor.`AutoID`)\n\n\t\t\tWHERE t.`UserID` ='" . $user->getID() . "'";
$user_transactions = DatabaseFactory::passinggreen_db()->query($q);
Debugger::log(Var_Dump::display($user_transactions, true));
while ($user_transactions_row = $user_transactions->fetch_object()) {
if ($user_transactions_row->UserID == $user->getID()) {
$user_balance += $user_transactions_row->amount;
//$referrals_passed[] = $row;
} else {
if ($user_transactions_row->VendorID == $user->getID()) {
$user_commission += $user_transactions_row->amount;
//$referrals_received[] = $row;
}
}
#else
#echo "PG.com +".$row->amount."<br>";
#echo "<pre>".print_r($row, true)."</pre>";
}
// referrals
$user_referrals_passed = DBObject::collection("Referral", DBObject::CONSISTENCY_ABSOLUTE)->applyUserIDFilter($user->getID())->getReferralCount();
$user_referrals_received = DBObject::collection("Referral", DBObject::CONSISTENCY_ABSOLUTE)->applyVendorIDFilter($user->getID())->getReferralCount();
Debugger::log("refs passed: {$user_referrals_passed}");
Debugger::log("refs recvd: {$user_referrals_received}");
// decrypt cc field if it is not empty
$user_crypt_key = CryptKey::findCryptKeyByUserID($user->getID());
if (isset($user_crypt_key) && $user_crypt_key->isValid()) {
Debugger::log("User crypt private key: " . $user_crypt_key->getKey());
$decoded_cc_data = unserialize(TwoWayEncryption::decrypt($user->getCC(), $user_crypt_key->getKey()));
} else {
$decoded_cc_data = null;
}
$return->id = $user->getID();
// object id
$return->user = $user->toArray();
// set the base return, values can be overridden below.
$return->user["userCompanyType[]"] = $user->getUserCompanyType();
$return->user["siteAreas[]"] = $user->getSiteAreas();
$return->user["passwd"] = null;
$return->user["balance"] = number_format($user_balance, 2);
if (!is_null($decoded_cc_data)) {
$return->user["ccc"] = $decoded_cc_data["details"];
$return->user["ccc_status"] = $decoded_cc_data["status"];
$return->user["ccc_tcode"] = $decoded_cc_data["tcode"];
$return->user["ccc_name"] = $decoded_cc_data["name"];
$return->user["ccc_ccNum"] = $decoded_cc_data["ccNum"];
$return->user["ccc_MM"] = $decoded_cc_data["MM"];
$return->user["ccc_YY"] = $decoded_cc_data["YY"];
$return->user["ccc_ccCode"] = $decoded_cc_data["ccCODE"];
}
$return->user["referralsPassed"] = $user_referrals_passed;
$return->user["referralsReceived"] = $user_referrals_received;
$return->user["accountBalance"] = number_format($user_balance, 2);
$return->user["commissionDue"] = number_format($user_commission, 2);
echo json_encode($return);
return;
} else {
$return->error = "ID is invalid.";
echo json_encode($return);
return;
}
} else {
$return->error = "Missing ID!";
echo json_encode($return);
return;
}
}