/**
  * 将当前系统的会员同步给UCenter
  * 规则
  * 1. 保证 easethink 中有的会员 ucenter 中必需存在,并同步密码
  * 2. 重名会员以 easethink 中的会员资料为准,并将原ucenter中的会员资料记录到log中
  * 3. ucenter中存在的会员。easethink中如不存在暂不处理。
  */
 private function import_user()
 {
     if (file_exists(APP_ROOT_PATH . "public/uc_config.php")) {
         require_once APP_ROOT_PATH . "public/uc_config.php";
         $ucdb = new mysql_db(UC_DBHOST, UC_DBUSER, UC_DBPW, UC_DBNAME, UC_DBCHARSET);
         $result = array('status' => 1, 'msg' => '');
         /*$uc_user = $ucdb->getAll("select * from ".UC_DBTABLEPRE."members");
           $et_user = $GLOBALS['db']->getAll("select * from ".DB_PREFIX."user");
           print_r($uc_user);
           print_r($et_user);
           exit;*/
         require_once APP_ROOT_PATH . "system/utils/logger.php";
         $query = $GLOBALS['db']->query("SELECT * FROM " . DB_PREFIX . "user ORDER BY `id` ASC");
         while ($data = $GLOBALS['db']->fetch_array($query)) {
             if (UC_CHARSET != 'utf-8') {
                 $data['user_name'] = iconv("utf-8", UC_CHARSET, $data['user_name']);
                 $data['user_pwd'] = iconv("utf-8", UC_CHARSET, $data['user_pwd']);
                 $data['email'] = iconv("utf-8", UC_CHARSET, $data['email']);
             }
             $salt = rand(100000, 999999);
             $password = md5($data['user_pwd'] . $salt);
             $data['user_name'] = addslashes($data['user_name']);
             $uc_userinfo = $ucdb->getRow("SELECT * FROM " . UC_DBTABLEPRE . "members WHERE `username`='" . $data['user_name'] . "'");
             if (!$uc_userinfo) {
                 $ucdb->query("INSERT INTO " . UC_DBTABLEPRE . "members SET username='******'user_name'] . "', password='******', email='" . $data['email'] . "', regdate='" . $data['create_time'] . "', salt='{$salt}'", 'SILENT');
                 $integrate_id = intval($ucdb->insert_id());
                 $GLOBALS['db']->query("update " . DB_PREFIX . "user set integrate_id = " . $integrate_id . " where id = " . $data['id']);
             } else {
                 //存在同名会员
                 //开始记录原系统同的同名数据
                 $data_str = implode("|", $data);
                 logger::record($data_str);
                 logger::save();
                 $GLOBALS['db']->query("update " . DB_PREFIX . "user set integrate_id = " . $uc_userinfo['uid'] . ",user_pwd = '' where id = " . $data['id']);
                 //清空原密码,等待同步登录时与ucenter同步
             }
         }
         unset($query);
     }
     return $result;
 }
Ejemplo n.º 2
0
               <table class="tabletitle">
                   <tr><td width="25%">文&nbsp;件&nbsp;标&nbsp;题</td><td width="30%">文&nbsp;件&nbsp;类&nbsp;型</td><td width="20%">文&nbsp;件&nbsp;大&nbsp;小</td><td width="25%">相&nbsp;关&nbsp;操&nbsp;作</td></tr>
                     <?php 
require 'connectionInfo.php';
//添加引用文件
mb_internal_encoding('utf-8');
//        $query = 'select * from '.$officeFileInfoTableName.'  order by filetype;'; //写入sql语句
$query = 'select * from ' . $officeFileInfoTableName;
//写入sql语句
/* Example */
//<!--读取数据库中的文件-->
$DB = new mysql_db();
//建立数据库辅助类
$DB->sql_connect($ip, $sqlname, $sqlpw, $dbname);
//建立一个新连接
$DB->query($query);
//执行sql
$rs = $DB->sql_result();
/* 处理结果集 */
while ($row = mysql_fetch_array($rs, MYSQL_BOTH)) {
    //       echo "<tr><td>{$row['id']}</td><td>{$row['filename']}</td><td>{$row['filetype']}</td><td>{$row['filesize']}</td><td><a href=\'javascript:showFileEditPage(\"FileEdit.php?FileId={{$row['id']}}\",900,800);\' > 编辑 </a></td></tr>";
    echo '<tr><td>' . $row['filename'] . '</td><td>' . $row['filetype'] . '</td><td>' . $row['filesize'] . '</td><td><a href="javascript:showFileEditPage(\'FileEdit.php?FileId=' . $row['id'] . '\',900,800);">编辑</a></td></tr>';
}
?>
		    <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
               </table>
               <table>
               <!--office文件列表-->
               </table>
           </div>
           <div id="htmllist" class="officelist">
Ejemplo n.º 3
0
 public function install($config_seralized)
 {
     $config = unserialize($config_seralized);
     if ($config['IS_LATIN1'] == 2) {
         $config['DB_CHARSET'] = 'latin1';
     }
     if (!@mysql_pconnect($config['DB_HOST'], $config['DB_USER'], $config['DB_PASS'])) {
         $result['status'] = 0;
         $result['msg'] = '无法连接数据库';
         return $result;
     } else {
         $pwdb = new mysql_db($config['DB_HOST'], $config['DB_USER'], $config['DB_PASS'], $config['DB_NAME'], $config['DB_CHARSET']);
         //开始将easethink的会员导入到pw中
         $query = $GLOBALS['db']->query("SELECT * FROM " . DB_PREFIX . "user ORDER BY `id` ASC");
         while ($data = $GLOBALS['db']->fetch_array($query)) {
             $pw_userinfo = $pwdb->getRow("SELECT * FROM " . $config['PREFIX'] . "members WHERE `username`='" . $data['user_name'] . "'");
             if (!$pw_userinfo) {
                 $pwdb->query("INSERT INTO " . $config['PREFIX'] . "members SET username='******'user_name'] . "', password='******'user_pwd'] . "', email='" . $data['email'] . "', regdate='" . $data['create_time'] . "'", 'SILENT');
                 $integrate_id = intval($pwdb->insert_id());
                 $GLOBALS['db']->query("update " . DB_PREFIX . "user set integrate_id = " . $integrate_id . " where id = " . $data['id']);
             } else {
                 //存在同名会员
                 $data['user_name'] = $data['user_name'] . $config['SUFFIX'];
                 $pwdb->query("INSERT INTO " . $config['PREFIX'] . "members SET username='******'user_name'] . "', password='******'user_pwd'] . "', email='" . $data['email'] . "', regdate='" . $data['create_time'] . "'", 'SILENT');
                 $integrate_id = intval($pwdb->insert_id());
                 $GLOBALS['db']->query("update " . DB_PREFIX . "user set integrate_id = " . $integrate_id . " where id = " . $data['id']);
             }
             /* 更新memberdata表 */
             $sql = 'INSERT INTO ' . $config['PREFIX'] . 'memberdata set uid = ' . $integrate_id;
             $pwdb->query($sql, "SILENT");
         }
         unset($query);
         $result['status'] = 1;
         return $result;
     }
 }
Ejemplo n.º 4
0
<?php

require 'connectionInfo.php';
//实现方式不包括删除重复的文件,而是不让他们重名。
$uploaddir = $relativePdfFileUrl;
if (array_key_exists('uploadPdf', $_FILES)) {
    if ($_FILES['uploadHtml']['size'] < 1024 * 1024 * 4) {
        $mResult = 0;
        $mSql = 'select max(id)+1 as MaxID from ' . $pdfFileInfoTableName . ';';
        $DB = new mysql_db();
        $DB->sql_connect($ip, $sqlname, $sqlpw, $dbname);
        //建立一个新连接
        $DB->query($mSql);
        $rs = $DB->sql_result();
        while ($row = mysql_fetch_array($rs, MYSQL_BOTH)) {
            $mResult = $row['MaxID'];
            if ($mResult == 0) {
                $mResult = 1;
            }
        }
        $uploadfile = $uploaddir . $mResult . '.' . $_FILES['uploadPdf']['name'];
        if (is_uploaded_file($_FILES['uploadPdf']['tmp_name'])) {
            $uploadfile1 = mb_convert_encoding($uploadfile, "GB2312", "UTF-8");
            if (move_uploaded_file($_FILES['uploadPdf']['tmp_name'], $uploadfile1)) {
                //                                    print '大小为:('.$_FILES['uploadPdf']['size'].')';
                $pdfFileName = $_FILES['uploadPdf']['name'];
                $pdffileSize = $_FILES['uploadPdf']['size'];
                print "成功保存文件:" . $_FILES['uploadPdf']['name'] . ".大小:" . $_FILES['uploadPdf']['size'] . "字节<br>";
                $SqlStr = 'insert into ' . $pdfFileInfoTableName . ' (id,pdffilename,pdffilepath,filesize)values(' . $mResult . ',"' . $pdfFileName . '","' . $uploadfile . '",' . $pdffileSize . ')';
                //                                    print $SqlStr;
                $rs = $DB->query($SqlStr);
Ejemplo n.º 5
0
     session_destroy();
     $UTILITY->location_goto(".");
 }
 if ($user_name1 != $userlogin && $user_pass1 != $password) {
     $UTILITY->popup_message("Maaf password atau username tidak ada!");
     session_destroy();
     $UTILITY->location_goto(".");
 }
 if ($user_name1 == $userlogin && $user_pass1 == $password) {
     $_SESSION["level{$ID}"] = $level_idlevel;
     $level = $level_idlevel;
     $_SESSION['user_id'] = $user_id;
     $_SESSION['email'] = $email;
     $_SESSION["user_name{$ID}"] = $userlogin;
     $_SESSION['unversitas'] = trim($universitas_iduniversitas);
     $qry = $DB->query("select namauniversitas from universitas where kodeUniversitas='{$_SESSION['unversitas']}' ");
     while ($row = $DB->fetch_object($qry)) {
         $nama_universitas = $row->namauniversitas;
     }
     $_SESSION['nama_unversitas'] = $nama_universitas;
     //enkripsi
     // $hash = $UTILITY->enkripsi($algoritma, $mode, $secretkey, "$user_id");
     //$user_id_hash = base64_decode($hash);
     //enkripsi
     //setting cookies --> paramater berasal dari application.php
     //echo "MASUKKK";
     $user_id_hash = $user_id;
     $status = setcookie($cookie_name, 'usr='******'&hash=' . $user_id_hash, time() + $cookie_time, "/", "{$domain}");
     //   $_SESSION['cookies'] = 'usr='******'&hash=' . $user_id_hash;
     if ($level == "4") {
         $UTILITY->location_goto("ch/view");
Ejemplo n.º 6
0
<?php 
require_once 'classes/classGRAPH.php';
require_once 'classes/classDB.php';
$hostname = "<host>:<port>";
$username = "******";
$password = "******";
$dbname = "<database>";
$objDB = new mysql_db();
$objDB->sql_connect($hostname, $username, $password, $dbname);
$ColumnChart = new Graph();
$ColumnChart->set_graphTitle("Hits Summary");
$ColumnChart->set_graphXLabel("Hour");
$ColumnChart->set_graphYLabel("Total Hits");
$ColumnChart->set_chartColumns(array("Hour", "Total Hits"));
$result = $objDB->query("select Hour(datetime) as hour, count(*) as hits from hits group by 1 order by 1 desc;");
$index = 0;
while ($line = $objDB->fetch_row($result)) {
    $rows[$index][0] = $line['hour'];
    $rows[$index][1] = $line['hits'];
    $index++;
}
$ColumnChart->set_chartRows($rows);
$ColumnChart->set_chartGraph("ColumnChart");
$ColumnChart->get_chartGraph();
$objDB->sql_close();
// -------------------------------------------------------------------------------------------------------------------------------
$LineChart = new Graph();
$LineChart->set_graphTitle("Hits Summary");
$LineChart->set_graphXLabel("Hour");
$LineChart->set_graphYLabel("Total Hits");