示例#1
0
function crnos($class1)
{
    if (!check('CR')) {
        echo "Error : Page allowed only to CRs";
    } else {
        include 'config/db.php';
        include 'config/settings.php';
        include 'config/globals.php';
        $branch = $globalbranch;
        $table = $branchyear . '_Students';
        $userid = $_SESSION['UserId'];
        $q = "select Branch,Class,Position from {$table} where Id = '{$userid}'";
        $res = mysql_query($q) or die(mysql_error());
        $row = mysql_fetch_array($res);
        $branch = $row['Branch'];
        $class = $row['Class'];
        if ($class1 != $class) {
            echo "Error: Not authorised to access {$branch}{$class1} details.";
        } else {
            $cnt = 1;
            $table = $branch . $class . '_Cache';
            $q = mysql_query("select `Id`,`RNo` from {$table}");
            $class_total = mysql_num_rows($q);
            while ($row = mysql_fetch_array($q)) {
                echo $row['RNo'];
                if ($cnt != $class_total) {
                    echo ",";
                }
                $cnt++;
            }
        }
    }
}
示例#2
0
 /**
  * You can edit an existing Comic using this function. The first argument 
  * 		must be the id of the row to be edited
  */
 function edit($id, $name, $feed, $url, $description = false, $type = false, $fetch_regexp = false, $title_match_regexp = false, $update_frequency = false)
 {
     if (!$id) {
         return -1;
     }
     $validation_errors = check($this->getValidationRules(), 2);
     if ($validation_errors) {
         $GLOBALS['QUERY']['error'] = "Please correct the errors before continuing...<br />" . $validation_errors;
         return false;
     }
     $this->newRow($id);
     $this->field['name'] = $name;
     $this->field['feed'] = $feed;
     $this->field['url'] = $url;
     if ($description !== false) {
         $this->field['description'] = $description;
     }
     if ($type !== false) {
         $this->field['type'] = $type;
     }
     if ($fetch_regexp !== false) {
         $this->field['fetch_regexp'] = $fetch_regexp;
     }
     if ($title_match_regexp !== false) {
         $this->field['title_match_regexp'] = $title_match_regexp;
     }
     if ($update_frequency !== false) {
         $this->field['update_frequency'] = $update_frequency;
     }
     return $this->save();
 }
示例#3
0
 function post()
 {
     global $_G;
     if ($_GET['onsubmit'] && check()) {
         $arr = array();
         $arr['title'] = trim_html($_GET['title'], 1);
         $arr['fid'] = intval($_GET['fid']);
         $value = $_GET['postdb'];
         $arr['value'] = serialize($value);
         $url = '';
         if ($_GET['id']) {
             $id = intval($_GET['id']);
             DB::update(__CLASS__, $arr, "id=" . $id);
             $url = '&id=' . $id;
             $msg = '修改';
         } else {
             $msg = '添加';
             $arr['dateline'] = TIMESTAMP;
             $arr['count'] = 0;
             $arr['updatetime'] = 0;
             $arr['count'] = 0;
             DB::insert(__CLASS__, $arr, true);
         }
         cpmsg($msg . '成功', 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__ . $url);
     } elseif ($_GET['id']) {
         $id = intval($_GET['id']);
         $rs = DB::fetch_first("SELECT * FROM " . DB::table('fetch') . " WHERE id = " . $id);
         $fetch = dunserialize($rs['value']);
         $fetch = array_merge($fetch, $rs);
         //dump($fetch);
     }
     $cates = (include libfile('config/taobao_cate'));
     $this->add(array('cates' => $cates, 'fetch' => $fetch));
     $this->show();
 }
示例#4
0
 public function process(Vtiger_Request $request)
 {
     $db = PearDatabase::getInstance();
     if ($request->get('file') == 'ShowModuleIdField') {
         $html = ShowModuleIdField($request->get('selected_module'));
         $response = new Vtiger_Response();
         $response->setResult($html);
         $response->emit();
     } elseif ($request->get('file') == 'CheckForTemplates') {
         include "modules/OSSPdf/CheckForTemplates_function.php";
         $value = check();
         $response = new Vtiger_Response();
         $response->setResult($value);
         $response->emit();
     } elseif ($request->get('file') == 'PDFExport') {
         include "modules/OSSPdf/PDFExport.php";
     } else {
         if ($request->get('mode') == 'Popup') {
             $html = Popup($request);
             $response = new Vtiger_Response();
             $response->setResult($html);
             $response->emit();
         }
     }
 }
示例#5
0
文件: Task.php 项目: binnyva/Tiker
 /**
  * You can edit an existing Task using this function. The first argument 
  * 		must be the id of the row to be edited
  */
 function edit($id, $name, $description = false, $status = false, $type = false, $completed_on = false, $project_id = false)
 {
     if (!$id) {
         return -1;
     }
     $validation_errors = check($this->getValidationRules(), 2);
     if ($validation_errors) {
         $GLOBALS['QUERY']['error'] = "Please correct the errors before continuing...<br />" . $validation_errors;
         return false;
     }
     $this->newRow($id);
     $this->field['name'] = $name;
     if ($description !== false) {
         $this->field['description'] = $description;
     }
     if ($completed_on !== false) {
         $this->field['completed_on'] = $completed_on;
     }
     if ($status !== false) {
         $this->field['status'] = $status;
     }
     if ($type !== false) {
         $this->field['type'] = $type;
     }
     if ($project_id !== false) {
         $this->field['project_id'] = $project_id;
     }
     return $this->save();
 }
示例#6
0
/**
 * Returns true if the current user has an acl compatible with $check.
 * Arguments of static methods of Granted can be passed as extra args.
 *
 * @param string $check
 * @return boolean
 */
function acl($check)
{
    global $current_user_acl;
    $acl = $current_user_acl;
    if ($acl['p']['ForbiddenAccess']) {
        return false;
    }
    if ($acl['p']['System']) {
        return true;
    }
    $result = false;
    $match = substr($check, 0, 2);
    switch ($match) {
        case 'u:':
        case 'g:':
        case 'p:':
            $type = substr($check, 0, 1);
            $target = substr($check, 2);
            $result = check($acl[$type], $target);
            break;
        default:
            $args = array_slice(func_get_args(), 1);
            if (is_callable(array('Granted', $check))) {
                $result = call_user_func_array(array('Granted', $check), $args);
            }
    }
    return $result;
}
示例#7
0
function check($dir)
{
    $dh = opendir($dir);
    while (false !== ($file = readdir($dh))) {
        if ($file == '.' || $file == '..') {
            continue;
        }
        if (is_dir($dir . '/' . $file)) {
            check($dir . '/' . $file);
        } elseif (preg_match('@\\.php$@', $file)) {
            $p = file_get_contents($dir . '/' . $file);
            if (preg_match('@^(.+)<\\?php@iU', $p, $m)) {
                echo $dir . '/' . $file . ' has padding space' . "\n";
            } elseif (preg_match('@\\?>(.+)$@iU', $p, $m)) {
                if ($m[1] === "\n" || ord($m[1][0]) === 13 && ord($m[1][1]) === 0) {
                    continue;
                }
                for ($i = 0; $i <= strlen($m[1]); $i++) {
                    $char = $m[1][$i];
                    echo $i . "/" . ord($char) . ": " . dechex(ord($char)) . "\n";
                }
                echo $dir . '/' . $file . ' has trailing space' . "\n";
                print_r($m);
            }
        }
    }
}
示例#8
0
	function __construct()
	{
		parent::__construct();
		// Set base crumb
		$this->bep_site->set_crumb($this->lang->line('backendpro_control_panel'),'admin');
		// Set container variable
		$this->_container = $this->config->item('backendpro_template_admin') . "container.php";
		$this->_phpinfocontainer = $this->config->item('backendpro_template_admin') . "phpinfocontainer.php";
		// Set Pop container variable
		$this->_popup_container = $this->config->item('backendpro_template_admin') . "popup.php";
		// Make sure user is logged in
		check('Control Panel');
		// Check to see if the install path still exists
		if( is_dir('install'))
		{
			flashMsg('warning',$this->lang->line('backendpro_remove_install'));
		}                
		// Set private meta tags
		//$this->bep_site->set_metatag('name','content',TRUE/FALSE);
		$this->bep_site->set_metatag('robots','nofollow, noindex');
		$this->bep_site->set_metatag('pragma','nocache',TRUE);
		// Load the ADMIN asset group
		$this->bep_assets->load_asset_group('ADMIN');
		// Loading module model for menu on the left
		$this->load->model('category/MCats');
		$this->load->model('currency/MCurrency');
		$this->lang->load('shop');
		$this->load->language('kaimonokago/kaimonokagoadmin');
		$this->load->language('welcome/webshop');
		log_message('debug','BackendPro : Admin_Controller class loaded');
	}
示例#9
0
    function on_action()
    {
        global $wpdb;
        function check($post)
        {
            $post = preg_replace("/\\,/sm", "", $post);
            $post = preg_replace("/<>/sm", "", $post);
            return $post;
        }
        if ($_POST['action'] == 'edit') {
            for ($i = 0; $i < count($_POST['set01']); $i++) {
                $set01 = $_POST['set01'][$i];
                $set02 = check($_POST['chage1_1'][$i]) . ',' . check($_POST['chage1_2'][$i]) . '<>';
                $set02 .= check($_POST['chage2_1'][$i]) . ',' . check($_POST['chage2_2'][$i]) . '<>';
                $set02 .= check($_POST['chage3_1'][$i]) . ',' . check($_POST['chage3_2'][$i]) . '<>';
                $set02 .= check($_POST['chage4_1'][$i]) . ',' . check($_POST['chage4_2'][$i]);
                $set03 = $_POST['set03'][$i];
                $setid = $_POST['in_id'][$i];
                $query = "update CART_cartedit set set01='{$set01}',set02='{$set02}',set03='{$set03}' where id={$setid}";
                $wpdb->query($query);
            }
            $this->message = '<div id="message" class="updated below-h2">
			<p>' . __('Settlement Method Setup data updated', 'WP-OliveCart') . '</p>
			</div>';
        }
        $mylink = $wpdb->get_results('SELECT * FROM CART_cartedit');
        $this->title = __('Settlement Method Setup', 'WP-OliveCart');
        $this->action = 'edit';
        $this->icon = 'cart';
        return $mylink;
    }
示例#10
0
 function sql_runquery()
 {
     global $_G;
     if ($_GET['onsubmit'] && check() && $_GET['query_string']) {
         $query_string = trim($_GET['query_string']);
         if (strstr($query_string, ';')) {
             $query_string = explode(';', $query_string);
         }
         $query_string = (array) $query_string;
         $update = true;
         $msg = '';
         $query_string = array_filter($query_string);
         $query_string = array_unique($query_string);
         $i = 0;
         foreach ($query_string as $k => $v) {
             if ($v) {
                 $cmd = trim(strtoupper(substr($v, 0, strpos($v, ' '))));
                 if ($cmd === 'UPDATE' || $cmd === 'DELETE') {
                     $update = false;
                 }
                 DB::query($v, array(), $update);
                 $msg .= '<p>' . $v . ',影响行数:' . DB::affected_rows() . '</p>';
                 $i++;
             }
         }
         cpmsg('成功执行:' . $i . '条SQL语句' . $msg, 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__, '', "<p claaa='red'>如果更改了某些系统数据,请手动更新系统缓存</p>");
         return false;
     }
     $this->show();
 }
 function Admin_Controller()
 {
     parent::Site_Controller();
     // Set base crumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_control_panel'), 'admin');
     // Set container variable
     $this->_container = $this->config->item('backendpro_template_admin') . "container.php";
     // Set Pop container variable
     $this->_popup_container = $this->config->item('backendpro_template_admin') . "popup.php";
     // Make sure user is logged in
     check('Control Panel');
     // Check to see if the install path still exists
     if (is_dir('install')) {
         flashMsg('warning', $this->lang->line('backendpro_remove_install'));
     }
     // Set private meta tags
     //$this->bep_site->set_metatag('name','content',TRUE/FALSE);
     $this->bep_site->set_metatag('robots', 'nofollow, noindex');
     $this->bep_site->set_metatag('pragma', 'nocache', TRUE);
     // Load the ADMIN asset group
     $this->bep_assets->load_asset_group('ADMIN');
     // Loading language file here rather than Shop_admin_controller.php.
     // Otherwise menu items will not be displayed
     $this->lang->load('shop');
     $this->load->module_language('kaimonokago', 'kaimonokagoadmin');
     $this->load->module_language('welcome', 'webshop');
     log_message('debug', 'BackendPro : Admin_Controller class loaded');
 }
示例#12
0
文件: game.php 项目: skiv71/connect4
function go($board, $colour, $cpu)
{
    $col = 0;
    showBoard($board);
    $cols = cols($board);
    if ($cpu == 0) {
        while (!in_array($col, $cols)) {
            $msg = 'player ' . $colour . ' - please choose a column (' . implode(',', $cols) . '): ';
            $col = readline($msg);
        }
    } else {
        sleep(0.5);
        print 'cpu thinking... ' . "\n";
        $col = $cols[array_rand($cols, 1)];
    }
    sleep(1);
    array_push($board[$col], $colour);
    if (check($board, $col)) {
        win($board, $colour);
        sleep(1);
        return 1;
    } else {
        return $board;
    }
}
示例#13
0
function image($path, $width = '', $height = '')
{
    if (check($path)) {
        return href('/public/scripts/timthumb.php?src=' . href($path) . '&w=' . $width . '&h=' . $height);
    } else {
        display_error('The image ' . href($path) . ' was not found');
    }
}
示例#14
0
	function __construct()
	{
		parent::__construct();
		check('Control Panel');
		
		// Load the ADMIN asset group
		$this->bep_assets->load_asset_group('ADMIN');
	}
 public function verify($username, $password)
 {
     $user = User::where('email', $username)->first();
     if ($user && check($password, $user->password)) {
         return $user;
     }
     return null;
 }
示例#16
0
 function Admin()
 {
     parent::Shop_Admin_Controller();
     // Check for access permission
     check('Messages');
     // Load model MMessages
     $this->load->model('MMessages');
     // Set breadcrumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_messages'), 'messages/admin');
 }
示例#17
0
	function __construct()
	{
		parent::__construct();
		check('Control Panel');
		
		// Load the ADMIN asset group
		$this->bep_assets->load_asset_group('ADMIN');
		$this->load->library('form_validation');
		$this->load->helper('language');
	}
示例#18
0
文件: checkdb.php 项目: Ekleog/platal
function info($sql, $comment = '', $onlyCounts = false)
{
    global $opt_verbose;
    if ($opt_verbose) {
        if ($onlyCounts) {
            checkCount($sql, $comment);
        } else {
            check($sql, $comment);
        }
    }
}
示例#19
0
文件: admin.php 项目: hungnv0789/vhtm
 function __construct()
 {
     parent::__construct();
     // Check for access permission
     check('Kho');        
   
     // load the MKho model
     $this->load->model('MKho');
     $this->module=basename(dirname(dirname(__FILE__)));      
     $this->bep_site->set_crumb($this->lang->line('backendpro_kho'),$this->module.'/admin');
 }
示例#20
0
 function __construct()
 {
     parent::__construct();
     // Load needed files
     $this->lang->load('access_control');
     // Check for access permission
     check('Access Control');
     // Set breadcrumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_access_control'), 'auth/admin/access_control');
     log_message('debug', 'BackendPro : Access_control class loaded');
 }
示例#21
0
function main()
{
    check('');
    check('id');
    check('blarblah');
    $cl = function () {
        return 'closure';
    };
    typehint($cl);
    typehint('id');
}
示例#22
0
 function Admin()
 {
     parent::Shop_Admin_Controller();
     // Check for access permission
     check('Customers');
     // load MCustomers model
     $this->load->model('MCustomers');
     $this->module = basename(dirname(dirname(__FILE__)));
     // Set breadcrumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_customers'), $this->module . '/admin');
 }
示例#23
0
文件: admin.php 项目: hungnv0789/vhtm
	function __construct()
	{
		parent::__construct();
	   	// Check for access permission
		check('Messages');
		// Load model MMessages
		$this->load->model('MMessages');
		$this->module=basename(dirname(dirname(__FILE__)));
		// Set breadcrumb
		$this->bep_site->set_crumb($this->lang->line('backendpro_messages'),$this->module.'/admin');	
    }
示例#24
0
 function Admin()
 {
     parent::Shop_Admin_Controller();
     // Check for access permission
     check('Category');
     $this->load->model('MCats');
     $this->module = basename(dirname(dirname(__FILE__)));
     //$this->module='category';
     // Set breadcrumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_category'), $this->module . '/admin');
     mb_internal_encoding('UTF-8');
 }
示例#25
0
文件: admin.php 项目: hungnv0789/vhtm
 function __construct()
 {
     parent::__construct();
     // Check for access permission
     check('Slideshow');
     // load the MSlideshow model
     //$this->load->model('MSlideshow');
     $this->module=basename(dirname(dirname(__FILE__)));
     //$this->module='slideshow';
     // Set breadcrumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_slideshow'),$this->module.'/admin');
 }
示例#26
0
文件: admin.php 项目: hungnv0789/vhtm
 function __construct()
 {
     parent::__construct();
     // Check for access permission
     check('Customers');
     // load MCustomers model
     $this->load->model('MCustomers');
     $this->bep_assets->load_asset('unmaskpassword');
     $this->module=basename(dirname(dirname(__FILE__)));
     // Set breadcrumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_customers'),$this->module.'/admin');
 }
示例#27
0
 function Admin()
 {
     parent::Shop_Admin_Controller();
     $this->load->model('MCalendar');
     $this->bep_assets->load_asset('master');
     // Check for access permission. Only if you have permission, you can access to Calendar
     check('Calendar');
     // We are going to use form helper. So load it.
     $this->module = basename(dirname(dirname(__FILE__)));
     $this->load->helper('form');
     // Set breadcrumb for the top level
     $this->bep_site->set_crumb($this->lang->line('backendpro_calendar'), 'calendar/admin');
 }
示例#28
0
文件: admin.php 项目: hungnv0789/vhtm
  	function __construct()
	{
		parent::__construct();
	// Check for access permission
		check('Orders');
		// load category model from module categories	
		$this->load->model('category/MCats');	
		$this->load->model('products/MProducts');	
		// load orders model
		$this->load->model('MOrders');
		// Set breadcrumb
		$this->bep_site->set_crumb($this->lang->line('backendpro_orders'),'orders/admin');		
	}
示例#29
0
 function Acl_actions()
 {
     parent::Admin_Controller();
     // Load needed files
     $this->lang->load('access_control');
     $this->load->model('access_control_model');
     // Check for access permission
     check('Actions');
     // Set breadcrumb
     $this->page->set_crumb($this->lang->line('backendpro_access_control'), 'auth/admin/access_control');
     $this->page->set_crumb($this->lang->line('access_actions'), 'auth/admin/acl_actions');
     log_message('debug', 'BackendPro : Acl_actions class loaded');
 }
示例#30
0
 function Admin()
 {
     parent::Shop_Admin_Controller();
     // Check for access permission
     check('Orders');
     // load category model from module categories
     $this->load->module_model('category', 'MCats');
     $this->load->module_model('products', 'MProducts');
     // load orders model
     $this->load->model('MOrders');
     // Set breadcrumb
     $this->bep_site->set_crumb($this->lang->line('backendpro_orders'), 'orders/admin');
 }