Example #1
0
 public function c($rq = null)
 {
     $type = ['employee' => 1, 'agency' => 2, 'doctor' => 3];
     $rq = rq();
     $rq['senderid'] = uid();
     $rq['sendername'] = username();
     if (he_is('agency')) {
         $rq['org'] = sess('org');
     }
     if (he_is('employee')) {
         $rq['org'] = sess('org');
     }
     // return his_chara()[0];
     $rq['sendertype'] = $type[his_chara()[0]];
     if (his_chara()[0] == 'agency') {
         $rq['recipienttype'] = 1;
         $rq['recipientid'] = 1;
         $rq['recipientname'] = 'admin';
     } elseif (his_chara()[0] == 'employee') {
         $rq['recipienttype'] = $type[$rq['recipienttype']];
     }
     // 验证发信规则
     $valid = $this->verify($rq);
     if (!$valid) {
         return ee(2);
     }
     $rq['sendtime'] = date("Y-m-d H:i:s");
     return parent::c($rq);
 }
 public function depQueryToResend()
 {
     $username = sess();
     $d = M('Department');
     $data = $d->select();
     return $data;
     //$this->assign('username', $username);
     //$this->assign('data', $data);
     //$this->display('ListByUser:resend');
 }
Example #3
0
 /**
  * 登入方法
  * @param null $input
  * @return array
  */
 public function login($input = null)
 {
     $input = $input ? $input : rq();
     if (!empty($input['user_type']) && $input['user_type'] == 'doctor' && !empty($input['cust_id'])) {
         $d = M('doctor');
         $d = $d->where('cust_id', $input['cust_id'])->first();
         if ($d) {
             log_him_in(['uid' => $d->id]);
             add_chara($input['user_type']);
             return ss();
         }
         return $d ? ss($d) : ee(2);
     }
     if (!empty($input['user_type']) && !empty($input['username']) && !empty($input['password'])) {
         $input['password'] = hash_password($input['password']);
         $user = $this->user_exists($input['user_type'], array_only($input, ['username', 'password']));
         if ($user) {
             $lifetime = 6000;
             log_him_in(['username' => $user->username, 'uid' => $user->id], $lifetime);
             add_chara($input['user_type']);
             if ($input['user_type'] == 'employee') {
                 sess('permission', $user->permissions);
             } else {
                 sess('permission', []);
             }
             if ($input['user_type'] == 'agency') {
                 sess('org', $user->name);
                 sess('name_in_charge', $user->name_in_charge);
             }
             if ($input['user_type'] == 'department') {
                 sess('org', $user->hospital_name . ':' . $user->name);
             }
             if ($input['user_type'] == 'employee') {
                 sess('org', $user->name);
             }
             // 添加日志
             ILog::login($input['user_type'], $user);
             return ss($user);
         }
     } else {
         return ee(2);
     }
     return ee(2);
 }
Example #4
0
 public function front()
 {
     $cache = Cache::get('i_settings', null);
     $per_page = array_get($cache, 'user.per_page');
     $d = ['debug' => debugging(), 'is_logged_in' => sess('is_logged_in'), 'his_chara' => sess('his_chara'), 'username' => sess('username'), 'uid' => sess('uid'), 'per_page' => $per_page, 'agency_end' => $this->retrieve('system.agency_end')];
     $type = ['employee' => 1, 'agency' => 2, 'doctor' => 3];
     // 获取未读通知
     if (uid()) {
         $d['unread'] = M('message')->where('recipientid', uid())->where('recipienttype', $type[his_chara()[0]])->where('read', 0)->count();
     } else {
         $d['unread'] = 0;
     }
     $d['org'] = '';
     if (he_is('agency')) {
         $org = DB::table(table_name('agency'))->select('name')->where('id', uid())->first();
         sess('org', $org->name);
         $d['org'] = sess('org');
     }
     if (he_is('employee')) {
         $d['org'] = sess('org');
     }
     return ss($d);
 }
Example #5
0
<?php

date_default_timezone_set("Europe/Moscow");
//подключение
include "includes/kernel.php";
db_connect();
$noclose = 0;
if (strpos($_REQUEST[action], "/") !== false || strpos($_REQUEST[action], "\\") !== false) {
    die("error");
}
sess($noclose);
//страница
if ($_REQUEST[action]) {
    $action = $_REQUEST[action];
} else {
    die("error");
}
//проверка наличия страницы
if (!file_exists("actions/" . $action . ".php")) {
    die("error");
}
//залогинен ли?
$user = islogin();
if (!$user && ($action != 'login' && $action != 'autologin' && $action != 'reg')) {
    redirect("index.php");
}
header('Content-Type: text/html; charset=windows-1251');
include "actions/" . $action . ".php";
Example #6
0
    if ($q->status == 200) {
        return json_decode($q->body, true);
    }
    return array();
}
$result = verify(REQUEST_URI, @file_get_contents('php://input'));
$email = isset($result['verifiedEmail']) ? strtolower($result['verifiedEmail']) : '';
$name = isset($result['displayName']) ? $result['displayName'] : '';
$firstName = isset($result['firstName']) ? $result['firstName'] : '';
$lastName = isset($result['lastName']) ? $result['lastName'] : '';
if (strlen($email)) {
    sess('u:id', "mailto:{$email}");
    sess('u:link', "mailto:{$email}");
    sess('u:name', strlen($name) ? $name : $email);
}
$next = sess('next', null);
if (!is_string($next) || !strlen($next)) {
    $next = '/login';
}
?>
<script type="text/javascript">
var next = <?php 
echo json_encode($next);
?>
;
if (opener) {
    opener.location = next;
    window.close();
} else {
    window.location = next;
}
Example #7
0
 function his_captcha_data()
 {
     $d = sess('him.captcha_data');
     if ($d) {
         return sess('him.captcha_data');
     }
     return 0;
 }
Example #8
0
$time = $TAGS[count($TAGS) - 1]['time'] - $TAGS[0]['time'];
$caller = $TAGS[count($TAGS) - 2];
$sparql_n = 0;
$sparql_t = 0;
if (isset($timings)) {
    $sparql_n = count($timings);
    foreach ($timings as $t) {
        $sparql_t += $t['time'];
    }
}
?>
<hr class="center" />
<div class="center align-right width-1024">
<?php 
$user_link = sess('u:link');
$user_name = sess('u:name');
if (is_null($user_name) || !strlen($user_name)) {
    $user_name = $_user;
}
if ($_options->coderev) {
    $src = explode('/', __FILE__);
    $src = array_slice($src, array_search('www', $src));
    $src = implode('/', $src);
    $src = "https://github.com/linkeddata/data.fm/tree/master/{$src}";
    $queryFoot = $sparql_n < 1 ? '' : sprintf('with %d quer%s in %ss', $sparql_n, $sparql_n > 1 ? 'ies' : 'y', substr($sparql_t, 0, 6));
    $versionFoot = implode(' / ', array('librdf: ' . array_shift(explode(' ', librdf_version_string_get())), 'raptor: ' . array_shift(explode(' ', raptor_version_string_get())), 'rasqal: ' . array_shift(explode(' ', rasqal_version_string_get()))));
    ?>
    <div class="footer">
        <span id="codeTime" ng-mouseenter="runtime=1" ng-mouseleave="runtime=0">
        <em ng-if="runtime"><?php 
    echo $versionFoot;
Example #9
0
 public function front()
 {
     $d = ['debug' => debugging(), 'is_logged_in' => sess('is_logged_in'), 'his_chara' => sess('his_chara'), 'username' => sess('username'), 'uid' => sess('uid')];
     return ss($d);
 }
Example #10
0
 private function processReporter($realName = '')
 {
     $formattedRet = array();
     if ($realName) {
         $var = $this->news_model->getDetailReporter($realName);
         if (count($var) > 0) {
             #$formattedRet[] = array('email' => $var[0]['user_email'],'user_fullname'=>$var[0]['user_realname']);
             $formattedRet[] = array('id' => $var[0]['user_id'], 'name' => $var[0]['user_realname']);
         }
     } else {
         $formattedRet[] = array('id' => sess('usr_id'), 'name' => sess('usr_fullname'));
     }
     return json_encode($formattedRet);
 }
 public function modiPassProcess()
 {
     $newpass = $_POST['confirm'];
     $username = sess();
     $u = M('User');
     $where['username'] = $username;
     $data['password'] = md5($newpass);
     $save = $u->where($where)->save($data);
     if (!$save) {
         $this->error('修改失败');
     }
     if ($username == 'admin') {
         $this->success('修改成功', "__APP__/User/modiUser", 2);
     } else {
         $this->success('修改成功', "__APP__/ListByUser/revBox", 2);
     }
 }
Example #12
0
 private function processReporter($realName = '')
 {
     $formattedRet = array();
     if ($realName != '') {
         if (strpos($realName, ',')) {
             $arr_nama = explode(',', $realName);
             foreach ($arr_nama as $key => $value) {
                 $var = $this->news_model->getDetailReporter($value);
                 if (count($var) > 0) {
                     $formattedRet[] = array('id' => $var[0]['user_id'], 'name' => $var[0]['user_realname']);
                 }
             }
         } else {
             $var = $this->news_model->getDetailReporter($realName);
             if (count($var) > 0) {
                 #$formattedRet[] = array('email' => $var[0]['user_email'],'user_fullname'=>$var[0]['user_realname']);
                 $formattedRet[] = array('id' => $var[0]['user_id'], 'name' => $var[0]['user_realname']);
             }
         }
     } else {
         $formattedRet[] = array('id' => sess('usr_id'), 'name' => sess('usr_fullname'));
     }
     return json_encode($formattedRet);
 }
 public function modiPass()
 {
     sess();
     $this->display();
 }
Example #14
0
File: user.php Project: reytej/Acct
 public function profile()
 {
     $this->load->helper('core/user_helper');
     $data = $this->syter->spawn('profile');
     $user = sess('user');
     // echo var_dump($user);
     $args = array();
     $join = array();
     $select = "users.*,user_roles.role";
     $args['users.id'] = $user['id'];
     $join['user_roles'] = array('content' => 'users.role=user_roles.id', 'mode' => 'left');
     $result = $this->site_model->get_tbl('users', $args, array(), $join, true, $select);
     $res = $result[0];
     $img = array();
     $resultIMG = $this->site_model->get_image(null, $user['id'], 'users');
     if (count($resultIMG) > 0) {
         $img = $resultIMG[0];
     }
     $data['code'] = userProfilePage($res, $img);
     $data['page_title'] = fa('fa-user') . " User Profile";
     $data['load_js'] = 'site/user';
     $data['use_js'] = 'profileJs';
     $this->load->view('page', $data);
 }
Example #15
0
function sess($id, $val = NULL)
{
    if (func_num_args() == 1) {
        return isSess($id) ? $_SESSION[$id] : NULL;
    } elseif (is_null($val)) {
        $r = isset($_SESSION[$id]) ? $_SESSION[$id] : null;
        unset($_SESSION[$id]);
        return $r;
    } else {
        $prev = sess($id);
        $_SESSION[$id] = $val;
        return $prev;
    }
}
Example #16
0
define('HEADER', 1);
if (!isset($TITLE)) {
    $TITLE = 'data cloud';
}
$user_link = sess('u:link');
$user_pic = '/common/images/nouser.png';
if (substr($_user, 0, 4) == 'dns:') {
    $user_name = $_user;
} else {
    if (is_null(sess('u:name'))) {
        if (is_null($user_name) || !strlen($user_name)) {
            $user_name = $_user;
        }
    } else {
        $user_name = sess('u:name');
        $user_pic = sess('u:pic');
    }
}
?>
<!DOCTYPE html>
<html class="ng-app">
<head>
    <title><?php 
echo $_SERVER['SERVER_NAME'];
?>
: <?php 
echo $TITLE;
?>
</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
 public function sendDetail()
 {
     $id = $_GET['id'];
     $username = sess();
     // 得到session中的用户名
     $this->assign('username', $username);
     // 显示登录的用户名
     $l = M('List_by_' . $username);
     $data = $l->where("id={$id}")->select();
     $this->assign('data', $data);
     $filename = urlencode($data[0]['filename']);
     $this->assign('filename', $filename);
     $revusers = explode(";", $data[0]['sendto']);
     $revusers_arr = array();
     for ($i = 0; $i < count($revusers_arr); $i++) {
         $revusers_arr[] = $revusers[$i];
     }
     for ($i = 0; $i < count($revusers_arr); $i++) {
         $filepath = $_SERVER['DOCUMENT_ROOT'] . 'MailFile/' . $revusers_arr[$i] . '/' . $data[0]['filename'];
         $filepath = iconv('utf-8', 'gb2312', $filepath);
         if (file_exists($filepath)) {
             $userfolder = $revusers_arr[$i];
         }
         # code...
     }
     $this->assign('userfolder', $userfolder);
     $this->display();
 }
Example #18
0
File: s.php Project: sgml/rww.io
 *  in the Software without restriction, including without limitation the rights 
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
 *  copies of the Software, and to permit persons to whom the Software is furnished 
 *  to do so, subject to the following conditions:
 *  The above copyright notice and this permission notice shall be included in all 
 *  copies or substantial portions of the Software.
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
 *  INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
 *  PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
 *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 *  SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
require_once 'runtime.php';
if (isset($i_reset)) {
    sess($i_reset, null);
}
if (!isset($i_debug)) {
    $r = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
    if (stristr($r, 'data.fm/')) {
        header('Location: ' . $r);
    } else {
        header('Location: /');
    }
    exit;
}
header('Content-type: text/plain');
print_r($_SESSION);
function request_k(&$item, $key)
{
    if (substr($key, 0, 5) == 'HTTP_') {
Example #19
0
            }
        }
    }
}
# ensure user props
if (sess('u:id')) {
    if (!isSess('u:link')) {
        sess('u:link', $_user);
    }
    if (!isSess('u:name')) {
        $_user_name = basename($_user);
        $c = strpos($_user_name, ':');
        if ($c > 0) {
            $_user_name = substr($_user_name, $c + 1);
        }
        sess('u:name', $_user_name);
    }
}
header("User: {$_user}");
// HTTP Access Control
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) {
    header('Access-Control-Allow-Headers: ' . $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']);
}
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) {
    header('Access-Control-Allow-Methods: ' . $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']);
}
if (isset($_SERVER['HTTP_ORIGIN'])) {
    $t = explode('/', $_SERVER['HTTP_ORIGIN']);
    if (count($t) > 2) {
        $n = "{$t[0]}//{$t[2]}";
    } else {
Example #20
0
<?php

include 'manutrack.php';
sess();
include 'header.php';
?>
<link rel="stylesheet" type="text/css" href="./resources/jeasyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="./resources/jeasyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="./resources/jeasyui/themes/color.css">
<link rel="stylesheet" type="text/css" href="./resources/jeasyui/demo/demo.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="newest.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="./resources/jeasyui/jquery.min.js"></script>
<script type="text/javascript" src="./resources/jeasyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/manuscript.js"></script>
<div id="main" class="main">
    <div id="sidebar"><?php 
include 'sidemenu_author.php';
?>
</div>
    <div style="margin-left: 220px; font-size: 14px;">
        <p><b>Once you have submitted a manuscript you MUST also provide a print copy by mail to:</p>
        <a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="displayManuscriptDialog()">New Manuscript
            Submission</a>
        <p>NeWest Press<br/>
            Attn: Acquisitions<br/>
            #201 8540 - 109 Street<br/>
            Edmonton, Alberta T6G 1E6</p>
        <p>For further information please see our <a href="https://newestpress.com/submissions" target="_blank">submission
                guidelines</a>.</p>
Example #21
0
 public function actionDiscount()
 {
     $p = $_POST["code"];
     $res = array("success" => true);
     $_SESSION["discount"] = $p;
     sess("discount", $p);
     $now = new CDbExpression('NOW()');
     Yii::import('admin.models.*');
     // $coupon= Coupon::model()->findByAttributes(
     //         array('name'=>$p,'status'=>1),
     //        'end_date<='. $now);
     // echo print_r($date);
     //die();
     $coupon = Coupon::model()->findAll(array('condition' => 'status=:status AND name=:name AND end_date < :date', 'params' => array(':status' => 1, ':name' => $p, ':date' => $now)));
     if ($coupon) {
         //print_r($coupon);
         $res = array("success" => true);
         $res["discount"] = (int) $coupon[0]->discount;
         echo json_encode($res);
     } else {
         $res = array("success" => false);
         unset($_SESSION["discount"]);
         echo json_encode($res);
     }
     // die();
     //   switch ($p) {
     //       case 'MFVideoMgr-100':
     //           $res["discount"] = 100;
     //           break;
     //       case 'MFVM-50A':
     //           $res["discount"] = 50;
     //           break;
     //       case 'MFVM25':
     //           $res["discount"] = 25;
     //           break;
     //       default:
     //           $res = array("success" => false);
     //           unset($_SESSION["discount"]);
     //           break;
     //   }
     //   echo json_encode($res);
 }