Example #1
0
    }
    $seed_array = array('A', 'R', 'T', 'I', 'S', 'F', 'O', 'C', 'E');
    $encodedStr = $encodedStr . "+" . $seed_array[$num];
    $encodedStr = base64_encode($encodedStr);
    return $encodedStr;
}
date_default_timezone_set('America/Los_Angeles');
$db = new mysqldb();
// First lets check for any jobs which are a) Schedule for any time NOW or before AND b) Status is PENDING (0)
// Now we need member id of campaign...  later we'll need list id... we can probably do this as part of the same query with a join
// while we're at it, let's get the message details?
$now = date('Y-m-d G:i:s', strtotime("now"));
$sql = "SELECT \r\nXJ.XE_JOB_ID AS JID,\r\nXJ.XE_JOB_CAMPAIGN_ID AS CID,\r\nXC.XE_CAMPAIGN_MID AS MID,\r\nXC.XE_CAMPAIGN_LIST_ID AS GID,\r\nXM.XE_MSG_FROM_LABEL AS FROM_LABEL,\r\nXM.XE_MSG_FROM_EMAIL AS FROM_EMAIL,\r\nXM.XE_MSG_SUBJECT AS SUBJECT,\r\nXM.XE_MSG_REPLY_TO AS REPLYTO,\r\nXM.XE_MSG_UNSUBSCRIBE AS UNSUBSCRIBE,\r\nXM.XE_MSG_POSTAL_ADDRESS AS ADDRESS,\r\nXM.XE_MSG_TEMPLATE_TEXT AS MSG_TXT,\r\nXM.XE_MSG_TEMPLATE_HTML AS MSG_HTML\r\nFROM XEBURA_JOBS AS XJ\r\nJOIN XEBURA_CAMPAIGN AS XC ON XJ.XE_JOB_CAMPAIGN_ID = XC.XE_CAMPAIGN_ID\r\nJOIN XEBURA_MESSAGE  AS XM ON XJ.XE_JOB_CAMPAIGN_ID = XM.XE_MSG_CAMPAIGN_ID\r\nWHERE XE_JOB_LAUNCH <= '" . $now . "'\r\nAND XE_JOB_STATUS = '0'";
//job status 0 = pending
// now that we've got the campaigns, we need to loop over them..
$db->query($sql);
$result = $db->query($sql);
$total_items = $db->getNumRows($result);
if ($db->getNumRows($result) > 0) {
    while (list($jid, $cid, $mid, $gid, $from_label, $from_email, $subject, $replyto, $unsubscribe, $address, $msg_txt, $msg_html) = $db->fetchQueryRow($result)) {
        // get the amazon credentials for the campaign creator
        $res = $db->query("SELECT\r\nXE_AMZ_ACCESS_KEY AS ACCESS_KEY,\r\nXE_AMZ_SECRET_KEY AS SECRET_KEY\r\nFROM XEBURA_AMAZON_CREDENTIALS\r\nWHERE XE_AMZ_MID = '" . $mid . "'");
        $row = $db->fetchQueryArray($res);
        $amz_akey = $row['ACCESS_KEY'];
        $amz_skey = $row['SECRET_KEY'];
        // intialize ses class
        $ses = new SimpleEmailService($amz_akey, $amz_skey);
        // now for our inner loop, let's find out who we're supposed to send this campaign out to, and loop over them.
        // need to add check for sending allowed status on email record to this query later
        // remove LIMIT
        // update campaign as launched
Example #2
0
//               256 South Robertson Blvd
//               Beverly Hills, CA 90211
//               USA
//               www.xebura.com
//               hello@xebura.com
//============================================================+
/* If the session exists for a user and it accidently comes to the index page
then first it unsets the message on session. */
if (isset($_SESSION['SHOWMESSAGE'])) {
    unset($_SESSION['SHOWMESSAGE']);
}
include "include/unsecure_includes.php";
if (isset($_REQUEST['username']) && trim($_REQUEST['username']) != "") {
    $db = new mysqldb();
    $sql = "select  * from  xebura_MEMBERS where USERNAME='******'username']) . "' and PASSWORD='******'password'])) . "' AND ACCOUNT_STATUS ='1'";
    $result = $db->query($sql);
    $num = $db->getNumRows($result);
    if ($num > 0) {
        $row = $db->fetchQueryArray($result);
        $aid = $row["AID"];
        $mid = $row["MID"];
        /*include "online.php";
        		$row=$db->fetchQueryArray($result);
        		$aid=$row["AID"]; echo $aid;
        		$mid=$row["MID"];echo $mid;
        		//exit;
        		if($_POST['username']!="")
        		{
        		$users_online_read = fopen("$log_file", "r");
        		$users_online = fread($users_online_read, filesize("$log_file"));
        		fclose($users_online_read);
Example #3
0
if (@(!$onl)) {
    $onl = new onlinedb();
}
if (@(!$smarty)) {
    $smarty = new Smarty();
}
if (@(!$mailobj)) {
    $mailobj = new MyEmail();
}
require_once 'language/smarty_assign.php';
if (!isset($hide_side_menu) || $hide_side_menu == true) {
    require_once 'sidemenu_details.php';
}
require_once 'validation.php';
$query = "SELECT LOGIN_STATUS, IS_TEMP_PASSWORD FROM xebura_MEMBERS WHERE MID = '" . $_SESSION['Member_Id'] . "'";
$result = $db->query($query);
if ($db->getNumRows($result) > 0) {
    $row = $db->fetchQueryArray($result);
    $smarty->assign("first_time_login", $row['LOGIN_STATUS']);
    if ($row['IS_TEMP_PASSWORD'] == 1) {
        $smarty->assign("temp_pass", 1);
    } else {
        $smarty->assign("temp_pass", 0);
    }
    // echo $row['LOGIN_STATUS'].'-->'.$row['IS_TEMP_PASSWORD'];
    if ($row['LOGIN_STATUS'] == 0 || $row['IS_TEMP_PASSWORD'] == 1) {
        // Do not show menu
        $show_user_menu = 0;
        $topmenu_opt = array("Home");
        $topmenu = array(_DASHBOARD);
    } else {
Example #4
0
if (@(!$onl)) {
    $onl = new onlinedb();
}
if (@(!$smarty)) {
    $smarty = new Smarty();
}
if (@(!$mailobj)) {
    $mailobj = new MyEmail();
}
require_once 'language/smarty_assign.php';
if (!isset($hide_side_menu) || $hide_side_menu == true) {
    require_once 'sidemenu_details.php';
}
require_once 'validation.php';
$query = "SELECT LOGIN_STATUS, IS_TEMP_PASSWORD FROM xebura_MEMBERS WHERE MID = '" . $_SESSION['Member_Id'] . "'";
$result = $db->query($query);
if ($db->getNumRows($result) > 0) {
    $row = $db->fetchQueryArray($result);
    $smarty->assign("first_time_login", $row['LOGIN_STATUS']);
    if ($row['IS_TEMP_PASSWORD'] == 1) {
        $smarty->assign("temp_pass", 1);
    } else {
        $smarty->assign("temp_pass", 0);
    }
    // echo $row['LOGIN_STATUS'].'-->'.$row['IS_TEMP_PASSWORD'];
    if ($row['LOGIN_STATUS'] == 0 || $row['IS_TEMP_PASSWORD'] == 1) {
        // Do not show menu
        $show_user_menu = 0;
        $topmenu_opt = array("Home");
        $topmenu = array(_DASHBOARD);
    } else {
 public function import_user()
 {
     //导入前,检查会员名,是否有重复的,有重复的不能执行导入
     ini_set("memory_limit", "100M");
     $cfg = unserialize(fanweC('INTEGRATE_CONFIG'));
     // INTEGRATE_CONFIG $_SESSION['cfg'];
     //echo VENDOR_PATH."mysql.php"; exit;
     //include_once(VENDOR_PATH."mysql.php");
     /*
     	    //include_once(__ROOT__."/app/source/class/mysql_db.php");
     	    include_once(FANWE_ROOT."/core/class/db.class.php");
     	    include_once(FANWE_ROOT."/core/class/mysql.class.php");
     	    $db_cfg = array(
     	    'DB_HOST'=>$cfg['db_host'],
     	    'DB_NAME'=>$cfg['db_name'],
     	    'DB_USER'=>$cfg['db_user'],
     	    'DB_PWD'=>$cfg['db_pass'],
     	    'DB_PORT'=>3306,
     	    'DB_PREFIX'=>$cfg['db_pre'],
     	    );
     	    $class = 'FDbMySql';	     
     	    $ucdb = &FDB::object($class);
     	    $ucdb->setConfig($db_cfg);
     	    $ucdb->connect();
     */
     $db_cfg = array('dbhost' => $cfg['db_host'], 'dbname' => $cfg['db_name'], 'dbuser' => $cfg['db_user'], 'dbpwd' => $cfg['db_pass'], 'dbcharset' => $cfg['db_charset'], 'pconnect' => '');
     Vendor('mysql');
     $ucdb = new mysqldb($db_cfg);
     //dump($ucdb); exit;
     Log::record("==================uc会员整合 begin======================");
     $item_list = M()->query("SELECT uid as id,user_name,password as user_pwd, ucenter_id, email, '' as last_ip,reg_time as create_time FROM " . C("DB_PREFIX") . "user ORDER BY `id` ASC");
     foreach ($item_list as $data) {
         $salt = rand(100000, 999999);
         $password = md5($data['user_pwd'] . $salt);
         //uc口令方式:md5(md5(明文)+随机值)
         if (strtolower($cfg['db_charset']) == 'gbk') {
             $data['username'] = addslashes(utf8ToGB($data['user_name']));
         } else {
             $data['username'] = addslashes($data['user_name']);
         }
         $uc_userinfo = $ucdb->fetchFirst("SELECT `uid`, `password`, `salt` FROM " . $cfg['db_pre'] . "members WHERE `username`='{$data['username']}'");
         //dump($uc_userinfo);
         if (!$uc_userinfo) {
             $ucdb->query("INSERT INTO " . $cfg['db_pre'] . "members SET username='******'username']}', password='******', email='{$data['email']}', regip='{$data['last_ip']}', regdate='{$data['create_time']}', salt='{$salt}'", 'SILENT');
             $lastuid = $ucdb->insertId();
             $ucdb->query("INSERT INTO " . $cfg['db_pre'] . "memberfields SET uid='{$lastuid}'", 'SILENT');
             M()->query("UPDATE " . C("DB_PREFIX") . "user SET `ucenter_id`='" . $lastuid . "' WHERE `uid`='" . $data['id'] . "'");
             //Log::record("INSERT INTO ".$cfg['db_pre']."members SET username='******', password='******', email='$data[email]', regip='$data[last_ip]', regdate='$data[create_time]', salt='$salt'");
             //Log::record("INSERT INTO ".$cfg['db_pre']."memberfields SET uid='$lastuid'");
             //M()->query("UPDATE " . C("DB_PREFIX") . "user SET `id`= $lastuid "." where id = ".$data['id']);
         } else {
             M()->query("UPDATE " . C("DB_PREFIX") . "user SET `ucenter_id`='" . $uc_userinfo['uid'] . "' WHERE `uid`='" . $data['id'] . "'");
             /*
             if ($merge_method == 1)//1:将与UC用户名和密码相同的用户强制为同一用户
             {
                 if (md5($data['user_pwd'].$uc_userinfo['salt']) == $uc_userinfo['password'])
                 {
                     //$merge_uid[] = $data['id'];
                     $uc_uid[] = array('user_id' => $data['id'],   	//旧会员ID
                     				  'uid' => $uc_userinfo['uid']	//新会员ID
                     				  );
                     continue;
                 }
             }
             */
             $ucdb->query("REPLACE INTO " . $cfg['db_pre'] . "mergemembers SET appid='" . UC_APPID . "', username='******'username']}'", 'SILENT');
             //Log::record("REPLACE INTO ".$cfg['db_pre']."mergemembers SET appid='".UC_APPID."', username='******'");
         }
     }
     //M()->query("UPDATE " . C("DB_PREFIX") . "user SET `ucenter_id`= ucenter_id_tmp");
     //Log::record("==================uc会员整合 end======================");
     //Log::save();
     clearCache();
     $this->assign('jumpUrl', u('Integrate/index'));
     $this->success('成功将会员数据导入到 UCenter');
 }
Example #6
0
if (@(!$onl)) {
    $onl = new onlinedb();
}
if (@(!$smarty)) {
    $smarty = new Smarty();
}
if (@(!$mailobj)) {
    $mailobj = new MyEmail();
}
require_once 'language/smarty_assign.php';
if (!isset($hide_side_menu) || $hide_side_menu == true) {
    require_once 'sidemenu_details.php';
}
require_once 'validation.php';
$query = "SELECT LOGIN_STATUS, IS_TEMP_PASSWORD FROM xebura_MEMBERS WHERE MID = '" . $_SESSION['Member_Id'] . "'";
$result = $db->query($query);
if ($db->getNumRows($result) > 0) {
    $row = $db->fetchQueryArray($result);
    $smarty->assign("first_time_login", $row['LOGIN_STATUS']);
    if ($row['IS_TEMP_PASSWORD'] == 1) {
        $smarty->assign("temp_pass", 1);
    } else {
        $smarty->assign("temp_pass", 0);
    }
    // echo $row['LOGIN_STATUS'].'-->'.$row['IS_TEMP_PASSWORD'];
    if ($row['LOGIN_STATUS'] == 0 || $row['IS_TEMP_PASSWORD'] == 1) {
        // Do not show menu
        $show_user_menu = 0;
        $topmenu_opt = array("Home");
        $topmenu = array(_DASHBOARD);
    } else {
Example #7
0
 function del($k)
 {
     return $this->db->query("DELETE from `{$this->table}` where k=?", $k);
     // should return 1 or 0
 }
Example #8
0
<?php

$_config['database']['hostname'] = "imattioapp.com";
$_config['database']['username'] = "******";
$_config['database']['password'] = "******";
$_config['database']['database'] = "imattioa_taxi";
/*$_config['database']['hostname'] = "localhost";
	$_config['database']['username'] = "******";
	$_config['database']['password'] = "******";
	$_config['database']['database'] = "imattio_taxi";*/
//connect the database server
$link = new mysqldb();
$link->connect($_config['database']);
$link->selectdb($_config['database']['database']);
$link->query("SET NAMES 'utf8'");
 /**
  * 执行SQL脚本文件
  *
  * @param array $filelist
  * @return string
  */
 private function restore($file, $db_config)
 {
     set_time_limit(0);
     $host = $db_config['DB_HOST'];
     if (!empty($db_config['DB_PORT'])) {
         $host = $db_config['DB_HOST'] . ':' . $db_config['DB_PORT'];
     }
     Vendor("mysql");
     $db = new mysqldb(array('dbhost' => $host, 'dbuser' => $db_config['DB_USER'], 'dbpwd' => $db_config['DB_PWD'], 'dbname' => $db_config['DB_NAME'], 'dbcharset' => 'utf8', 'pconnect' => 0));
     $sql = file_get_contents($file);
     $sql = $this->remove_comment($sql);
     $sql = trim($sql);
     $bln = true;
     $tables = array();
     $sql = str_replace("\r", '', $sql);
     $segmentSql = explode(";\n", $sql);
     $table = "";
     foreach ($segmentSql as $k => $itemSql) {
         $itemSql = trim(str_replace("%DB_PREFIX%", $db_config['DB_PREFIX'], $itemSql));
         if (strtoupper(substr($itemSql, 0, 12)) == 'CREATE TABLE') {
             $table = preg_replace("/CREATE TABLE (?:IF NOT EXISTS |)(?:`|)([a-z0-9_]+)(?:`|).*/is", "\\1", $itemSql);
             if (!in_array($table, $tables)) {
                 $tables[] = $table;
             }
             if ($db->query($itemSql) === false) {
                 $bln = false;
                 showjsmessage("建立数据表 " . $table . " ... 失败", 1);
                 break;
             } else {
                 showjsmessage("建立数据表 " . $table . " ... 成功");
             }
         } else {
             if ($db->query($itemSql) === false) {
                 $bln = false;
                 showjsmessage("添加数据表 " . $table . " ... 数据失败", 1);
                 break;
             }
         }
     }
     return $bln;
 }