".get_popup($link, $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=600,height=420,resizable=1" ).""; } function check_login() { if( !isset( $_SESSION['operator'] ) ) { if( isset($_COOKIE['webim_lite']) ) { list($login,$pwd) = split(",", $_COOKIE['webim_lite'], 2); $op = operator_by_login($login); if( $op && isset($pwd) && isset($op['vcpassword']) && md5($op['vcpassword']) == $pwd ) { $_SESSION['operator'] = $op; return $op; } } $_SESSION['backpath'] = $_SERVER['PHP_SELF']; header("Location: /webim/operator/login.php"); exit; } return $_SESSION['operator']; } function get_logged_in() { return isset( $_SESSION['operator'] ) ? $_SESSION['operator'] : FALSE; } function login_operator($operator,$remember) { $_SESSION['operator'] = $operator; if( $remember ) { $value = $operator['vclogin'].",".md5($operator['vcpassword']); setcookie('webim_lite', $value, time()+60*60*24*1000, "/webim/"); } else if( isset($_COOKIE['webim_lite']) ) { setcookie('webim_lite', '', time() - 3600, "/webim/"); } } function logout_operator() { $_SESSION['operator'] = NULL; $_SESSION['backpath'] = NULL; if( isset($_COOKIE['webim_lite']) ) { setcookie('webim_lite', '', time() - 3600, "/webim/"); } } ?>