コード例 #1
0
 public function updateFB()
 {
     if (Efiwebsetting::getData('checkOAuth') == 'yes') {
         IMBAuth::checkOAuth();
     }
     $fb_id = addslashes($_POST['macc_fb_id']);
     $macc_id = addslashes($_POST['macc_id']);
     //$fb_id = addslashes($_POST['macc_fb_id']);
     if ($fb_id == "" || $macc_id == "") {
         $json['status_code'] = 0;
         $json['status_message'] = "Invalid FB/LL ID";
         echo json_encode($json);
         die;
     }
     //update di lokal saja
     $ll = new LL_Account();
     $ll->getByID($macc_id);
     $ll->macc_fb_id = $fb_id;
     $ll->load = 1;
     if ($ll->save()) {
         $json['status_code'] = 1;
         $json['status_message'] = "FB ID From {$macc_id} updated to " . $fb_id;
     } else {
         $json['status_code'] = 0;
         $json['status_message'] = "Save Failed";
     }
     echo json_encode($json);
     die;
 }
コード例 #2
0
 public static function setSession($data, $remember)
 {
     $_SESSION['member'] = $data;
     $_SESSION['member_token'] = self::generateRandomString(15);
     $_SESSION["member_session"] = 1;
     $acc = new LL_Account();
     $acc->macc_id = $data->macc_id;
     $acc->fill(toRow($data));
     $acc->macc_login_date = leap_mysqldate();
     $acc->macc_token = $_SESSION['member_token'];
     $acc->save(1);
     self::setCookie($data, $remember, $acc->macc_acquire_date);
     return array('id' => $data->macc_id, 'token' => $acc->macc_token, 'name' => $data->macc_first_name . " " . $data->macc_last_name);
 }