Skip to content

Instantly share code, notes, and snippets.

@awakmu
awakmu / VALIDATE or REJECT
Created February 26, 2013 08:41
VALIDATE or REJECT
function user_profile_handler()
{
/* database connection */
$con = option('con');
if(
/* validate valid login dan role */
!empty($_SESSION['username']) && !empty($_SESSION['role_id']) &&
in_array($_SESSION['role_id'], array(option('role_super'), option('role_admin'), option('role_customer'))) &&
@awakmu
awakmu / user.php
Created February 26, 2013 08:44
VALIDATE or REJECT
function user_profile_handler()
{
/* database connection */
$con = option('con');
if(
/* validate valid login dan role */
!empty($_SESSION['username']) && !empty($_SESSION['role_id']) &&
in_array($_SESSION['role_id'], array(option('role_super'), option('role_admin'), option('role_customer'))) &&