예제 #1
0
function checksession($sg = null)
{
    if ($sg != null && isset($_SESSION['operatorid'])) {
        $ap = new Approval();
        $ap->setValue('skillgroup', $sg);
        $ap->setValue('operatorid', $_SESSION['operatorid']);
        if ($ap->checkAuthority()) {
            return true;
        } else {
            return false;
        }
    }
    if (isset($_SESSION['user'])) {
        if (isset($_SESSION["LAST_ACTIVITY"])) {
            if (time() - $_SESSION["LAST_ACTIVITY"] > 300) {
                // last request was more than 30 minutes ago
                session_unset();
                // unset $_SESSION variable for the run-time
                session_destroy();
                // destroy session data in storage
                return false;
            } else {
                $_SESSION["LAST_ACTIVITY"] = time();
                // update last activity time stamp
                return true;
            }
        }
    }
    return false;
}
예제 #2
0
\t\t\t\t<li><a href="partconfiguration.html" target="right">View Part Configuration</a></li>
\t\t\t\t<li><a href="ecn.html" target="right">Create ECN</a></li>
\t\t\t\t<li><a href="viewecn.html" target="right">View ECN</a></li>
\t\t\t\t<li><a href="drawingconfiglist.html" target="right">Drawing Configuration List</a></li>
\t\t\t\t<li><a href="productionsummary.html" target="right">Production Summary</a></li>
\t\t\t\t</ul> 
\t\t\t</li>  
\t\t\t<li> 
\t\t\t\t<a href="#">Tool</a> 
\t\t\t\t<ul > 
\t\t\t\t\t<li><a href="operationtoollist.html" target="right">View Tool List For Operation</a></li>
\t\t\t\t\t<li><a href="toolchangelog.html" target="right">View Tool USage Log</a></li>\t\t\t\t\t
\t\t\t\t\t<li><a href="toolsearch.html" target="right">Tool Search</a></li>
_END;
$au->setValue('skillgroup', 7);
if ($au->checkAuthority()) {
    echo <<<_END
\t\t\t\t\t<li><a href="tool.html" target="right">New Tool</a></li>
\t\t\t\t\t<li><a href="toolbody.html" target="right">New Tool Body</a></li>
\t\t\t\t\t<li><a href="holder.html" target="right">New Holder</a></li>
\t\t\t\t\t<li><a href="toolstock.html" target="right">Add Tool Stock</a></li>
\t\t\t\t\t<li><a href="toolbodystock.html" target="right">Add Tool Body Stock</a></li>
\t\t\t\t\t<li><a href="holderstock.html" target="right">Add Holder Stock</a></li>\t\t\t\t\t
\t\t\t\t\t<li><a href="opetool.html" target="right">Create Tool List For Operation</a></li>
\t\t\t\t\t<li><a href="ope_tool_copy.html" target="right"><style="color:red">Import Tool List From Old ERP</font></a></li>
\t\t\t\t\t<li><a href="copy_tools_new_erp.html" target="right"><style="color:red">Copy Tool List With In New ERP</font></a></li>
_END;
}
echo <<<_END
\t\t\t\t\t<li><a href="opetoolbatch.html" target="right">Issue Tools For Operation</a></li>
\t\t\t\t</ul>