当前位置: 首页>>代码示例>>PHP>>正文


PHP make_ref函数代码示例

本文整理汇总了PHP中make_ref函数的典型用法代码示例。如果您正苦于以下问题:PHP make_ref函数的具体用法?PHP make_ref怎么用?PHP make_ref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了make_ref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: table_services

    function table_services()
    {
        global $construct, $db, $lang;
        $form_search_services = $this->form_search_services();
        $where = $form_search_services->db_data_where();
        $table_services = new table(array('TABLE_NAME' => 'table_services', 'FORM_NAME' => 'table_services'));
        $table_services->db_data('services.title, nodes.name AS nodes__name, nodes.id AS nodes__id, ip_addresses.ip, nodes_services.url, nodes_services.info, nodes_services.date_in, nodes_services.status, IFNULL(nodes_services.protocol, services.protocol) AS protocol, IFNULL(nodes_services.port, services.port) AS port', 'nodes_services
			LEFT JOIN nodes on nodes_services.node_id = nodes.id
			LEFT JOIN services on nodes_services.service_id = services.id
			LEFT JOIN ip_addresses ON ip_addresses.id = nodes_services.ip_id', $where, '', "nodes_services.date_in DESC");
        $table_services->db_data_search($form_search_services);
        foreach ((array) $table_services->data as $key => $value) {
            if ($key != 0) {
                if ($table_services->data[$key]['ip']) {
                    $table_services->data[$key]['ip'] = long2ip($table_services->data[$key]['ip']);
                    if ($table_services->data[$key]['protocol'] && $table_services->data[$key]['port']) {
                        $table_services->data[$key]['ip'] .= ' (' . $lang['db']['nodes_services__protocol-' . $table_services->data[$key]['protocol']] . '/' . $table_services->data[$key]['port'] . ')';
                    }
                }
                $table_services->data[$key]['nodes__name'] .= " (#" . $table_services->data[$key]['nodes__id'] . ")";
                $table_services->info['LINK']['nodes__name'][$key] = make_ref('/nodes', array("node" => $table_services->data[$key]['nodes__id']));
                $table_services->info['LINK']['services__title'][$key] = htmlspecialchars($table_services->data[$key]['url']);
            }
        }
        $table_services->db_data_translate('nodes_services__status');
        $table_services->db_data_remove('nodes__id', 'nodes_services__id', 'url', 'protocol', 'port');
        return $table_services;
    }
开发者ID:southern-wind,项目名称:wind,代码行数:28,代码来源:services.php

示例2: table_services

    function table_services()
    {
        global $construct, $db, $main, $lang;
        $form_search_services_edit = $this->form_search_services_edit();
        $where = $form_search_services_edit->db_data_where();
        $table_services = new table(array('TABLE_NAME' => 'table_services', 'FORM_NAME' => 'table_services'));
        $table_services->db_data('services.title, nodes_services.id, nodes.name, nodes.id AS nodes__id, ip_addresses.ip, nodes_services.date_in, nodes_services.info, nodes_services.status, IFNULL(nodes_services.protocol, services.protocol) AS protocol, IFNULL(nodes_services.port, services.port) AS port', 'nodes_services
			LEFT JOIN nodes on nodes_services.node_id = nodes.id
			LEFT JOIN services on nodes_services.service_id = services.id
			LEFT JOIN ip_addresses ON ip_addresses.id = nodes_services.ip_id', $where, '', "nodes_services.date_in DESC");
        $table_services->db_data_search($form_search_services_edit);
        foreach ((array) $table_services->data as $key => $value) {
            if ($key != 0) {
                if ($table_services->data[$key]['ip']) {
                    $table_services->data[$key]['ip'] = long2ip($table_services->data[$key]['ip']);
                    if ($table_services->data[$key]['protocol'] && $table_services->data[$key]['port']) {
                        $table_services->data[$key]['ip'] .= ' (' . $lang['db']['nodes_services__protocol-' . $table_services->data[$key]['protocol']] . '/' . $table_services->data[$key]['port'] . ')';
                    }
                }
                $table_services->data[$key]['name'] .= " (#" . $table_services->data[$key]['nodes__id'] . ")";
                $table_services->info['EDIT'][$key] = make_ref('/node_editor/services', array("node" => $table_services->data[$key]['nodes__id'], "service" => $table_services->data[$key]['id']));
            }
        }
        $table_services->info['EDIT_COLUMN'] = 'title';
        $table_services->db_data_translate('nodes_services__status');
        $table_services->db_data_multichoice('nodes_services', 'id');
        $table_services->info['MULTICHOICE_LABEL'] = 'delete';
        $table_services->db_data_remove('id', 'nodes__id', 'protocol', 'port');
        return $table_services;
    }
开发者ID:southern-wind,项目名称:wind,代码行数:30,代码来源:admin_nodes_services.php

示例3: output

 function output()
 {
     $this->tpl['suggest_url'] = make_ref('/search/suggest');
     header('Content-Type: text/javascript');
     echo template($this->tpl, __FILE__);
     exit;
 }
开发者ID:southern-wind,项目名称:wind,代码行数:7,代码来源:search_suggest_js.php

示例4: table_ip_ranges

    function table_ip_ranges()
    {
        global $construct, $db;
        $form_search_ranges = $this->form_search_ranges();
        $where = $form_search_ranges->db_data_where(array('ip' => 'exclude'));
        $table_ip_ranges = new table(array('TABLE_NAME' => 'table_ip_ranges', 'FORM_NAME' => 'table_ip_ranges'));
        $where = $where != '' ? "(" . $where . ") AND " : "";
        if ($form_search_ranges->data[0]['value'] != '') {
            $where .= "(";
            $s_ranges = ip_to_ranges($form_search_ranges->data[0]['value']);
            foreach ($s_ranges as $s_range) {
                $where .= "(ip_ranges.ip_start BETWEEN " . ip2long($s_range['min']) . " AND " . ip2long($s_range['max']) . ") OR ";
            }
            $where = substr($where, 0, -4) . ") AND ";
        }
        if ($where != '') {
            $where = substr($where, 0, -5);
        }
        $table_ip_ranges->db_data('"" AS ip_range, ip_ranges.ip_start, ip_ranges.ip_end, ip_ranges.date_in, ip_ranges.status, nodes.name AS nodes__name, nodes.id AS nodes__id', 'ip_ranges
			LEFT JOIN nodes ON ip_ranges.node_id = nodes.id', $where != '' ? "(" . $where . ")" : "", "", "ip_ranges.status ASC, ip_ranges.ip_start ASC");
        $table_ip_ranges->db_data_search($form_search_ranges);
        foreach ((array) $table_ip_ranges->data as $key => $value) {
            if ($key != 0) {
                $table_ip_ranges->data[$key]['ip_start'] = long2ip($table_ip_ranges->data[$key]['ip_start']);
                $table_ip_ranges->data[$key]['ip_end'] = long2ip($table_ip_ranges->data[$key]['ip_end']);
                $table_ip_ranges->data[$key]['ip_range'] = $table_ip_ranges->data[$key]['ip_start'] . " - " . $table_ip_ranges->data[$key]['ip_end'];
                $table_ip_ranges->data[$key]['nodes__name'] .= " (#" . $table_ip_ranges->data[$key]['nodes__id'] . ")";
                $table_ip_ranges->info['EDIT'][$key] = make_ref('/nodes', array("node" => $table_ip_ranges->data[$key]['nodes__id']));
            }
        }
        $table_ip_ranges->info['EDIT_COLUMN'] = 'nodes__name';
        $table_ip_ranges->db_data_remove('ip_start', 'ip_end', 'nodes__id');
        $table_ip_ranges->db_data_translate('ip_ranges__status');
        return $table_ip_ranges;
    }
开发者ID:southern-wind,项目名称:wind,代码行数:35,代码来源:ranges_search.php

示例5: output

 function output()
 {
     global $main, $construct, $vars, $lang;
     if ($this->hide) {
         return;
     }
     if (file_exists(ROOT_PATH . 'config/mylogo.png')) {
         $this->tpl['mylogo'] = TRUE;
         $this->tpl['mylogo_dir'] = ROOT_PATH . 'config/';
     }
     $this->tpl['link_home'] = make_ref('/');
     $this->tpl['link_login_form'] = make_ref('/users/loginform');
     $this->tpl['link_logout'] = make_ref('/users', array('action' => 'logout'));
     $this->tpl['current_language'] = $vars['info']['current_language'];
     $this->tpl['search_url'] = make_ref('/search');
     foreach ($vars['language']['enabled'] as $key => $value) {
         if ($value) {
             $this->tpl['languages'][$key]['name'] = $lang['languages'][$key] == '' ? $key : $lang['languages'][$key];
             $this->tpl['languages'][$key]['link'] = self_ref(array("session_lang" => $key));
         }
     }
     if ($main->userdata->logged) {
         $this->tpl['logged'] = $main->userdata->logged;
         $this->tpl['logged_username'] = isset($main->userdata->info['username']) ? $main->userdata->info['username'] : "";
         $this->tpl['logged_title'] = get_user_title();
         $this->tpl['link_user_profile'] = make_ref('/users', array("user" => $main->userdata->user));
     } else {
         $this->tpl['link_register'] = make_ref('/users', array("user" => "add"));
         $this->tpl['link_restore_password'] = make_ref('/users', array("action" => "restore"));
         $this->tpl['link_register'] = make_ref('/users', array("user" => "add"));
     }
     return template($this->tpl, __FILE__);
 }
开发者ID:spinza,项目名称:wind,代码行数:33,代码来源:main_header.php

示例6: table_dns

    function table_dns()
    {
        global $construct, $db, $vars;
        $form_search_dns = $this->form_search_dns();
        if (substr($form_search_dns->data[1]['value'], -strlen("." . $vars['dns']['root_zone'])) == "." . $vars['dns']['root_zone']) {
            $form_search_dns->data[1]['value'] = substr($form_search_dns->data[1]['value'], 0, -strlen("." . $vars['dns']['root_zone']));
        }
        $where = $form_search_dns->db_data_where(array("dns_zones__name" => "starts_with"));
        $table_dns = new table(array('TABLE_NAME' => 'table_dns', 'FORM_NAME' => 'table_dns'));
        $table_dns->db_data('dns_zones.id AS dns_zones__id, dns_zones.name AS dns_zones__name, dns_zones.type, dns_zones.date_in, dns_zones.status, nodes.name AS nodes__name, nodes.id AS nodes__id', 'dns_zones
			LEFT JOIN nodes ON dns_zones.node_id = nodes.id', $where, "", "dns_zones.status ASC, dns_zones.type ASC, dns_zones.name ASC");
        $table_dns->db_data_search($form_search_dns);
        for ($i = 1; $i < count($table_dns->data); $i++) {
            if (isset($table_dns->data[$i])) {
                $table_dns->data[$i]['nodes__name'] .= " (#" . $table_dns->data[$i]['nodes__id'] . ")";
                if ($table_dns->data[$i]['type'] == 'forward') {
                    $table_dns->data[$i]['dns_zones__name'] .= "." . $vars['dns']['root_zone'];
                }
                $table_dns->info['EDIT'][$i] = make_ref('/nodes', array("node" => $table_dns->data[$i]['nodes__id']));
            }
        }
        $table_dns->info['EDIT_COLUMN'] = 'nodes__name';
        $table_dns->db_data_remove('dns_zones__id', 'type', 'nodes__id');
        $table_dns->db_data_translate('dns_zones__status');
        return $table_dns;
    }
开发者ID:southern-wind,项目名称:wind,代码行数:26,代码来源:dnszones.php

示例7: output

 function output()
 {
     global $db, $vars;
     $q = get('q');
     if (strrpos($q, "#") !== false && intval(substr(strrchr($q, '#'), 1)) != 0) {
         $q = intval(substr(strrchr($q, '#'), 1));
     }
     if (is_numeric($q) && strpos($q, ".") === FALSE) {
         $path = '/nodes';
         $qs = array('node' => $q);
     } elseif ($db->cnt('', 'nodes', "name = '" . $q . "'") == 1) {
         $node = $db->get('id', 'nodes', "name = '" . $q . "'");
         $path = '/nodes';
         $qs = array('node' => $node[0]['id']);
     } elseif (is_ip($q, FALSE)) {
         $path = '/ranges/search';
         $qs = array("form_search_ranges_search" => serialize(array("ip" => $q)));
     } elseif (substr($q, -strlen("." . $vars['dns']['root_zone'])) == "." . $vars['dns']['root_zone']) {
         $path = '/dnszones';
         $qs = array("form_search_dns_search" => serialize(array("dns_zones__name" => $q)));
     } else {
         $path = '/nodes';
         $qs = array("form_search_nodes_search" => serialize(array("nodes__name" => $q)));
     }
     redirect(make_ref($path, $qs));
 }
开发者ID:southern-wind,项目名称:wind,代码行数:26,代码来源:search_query.php

示例8: output

 function output()
 {
     global $main, $lang;
     $menu_addr = $main->menu->main_menu->getRootEntry()->getChild('addresses');
     $menu_addr->createLink($lang['ip_ranges_search'], make_ref('/ranges/search'));
     $menu_addr->createLink($lang['ip_ranges_allocation'], make_ref('/ranges/allocation'));
     return $this->page->output();
 }
开发者ID:southern-wind,项目名称:wind,代码行数:8,代码来源:ranges.php

示例9: table_ip_ranges

    function table_ip_ranges()
    {
        global $construct, $db, $lang;
        $form_search_ranges = $this->form_search_ranges();
        $where = $form_search_ranges->db_data_where(array('ip' => 'exclude', 'nodes__name' => 'starts_with', "total_active_p2p" => 'exclude', "total_active_aps" => 'exclude'));
        $table_ip_ranges = new table(array('TABLE_NAME' => 'table_ip_ranges', 'FORM_NAME' => 'table_ip_ranges'));
        $where = $where != '' ? "(" . $where . ") AND " : "";
        if ($form_search_ranges->data[0]['value'] != '') {
            $where .= "(";
            $s_ranges = ip_to_ranges($form_search_ranges->data[0]['value']);
            foreach ($s_ranges as $s_range) {
                $where .= "(ip_ranges.ip_start BETWEEN " . ip2long($s_range['min']) . " AND " . ip2long($s_range['max']) . ") OR ";
            }
            $where = substr($where, 0, -4) . ") AND ";
        }
        if ($where != '') {
            $where = substr($where, 0, -5);
        }
        $having = $form_search_ranges->db_data_where(array('ip' => 'exclude', 'ip_ranges__status' => 'exclude', 'ip_ranges__delete_req' => 'exclude', 'nodes__id' => 'exclude', 'nodes__name' => 'exclude'));
        $table_ip_ranges->db_data('ip_ranges.id, 
				"" AS ip_range, 
				ip_ranges.ip_start, 
				ip_ranges.ip_end, 
				ip_ranges.date_in, 
				ip_ranges.status, 
				ip_ranges.delete_req, 
				COUNT(DISTINCT p2p.id) AS total_active_p2p, 
				COUNT(DISTINCT aps.id) AS total_active_aps, 
				"" AS total_active_peers', 'ip_ranges ' . 'LEFT JOIN nodes ON ip_ranges.node_id = nodes.id 
				LEFT JOIN links ON ip_ranges.node_id = links.node_id AND links.status = "active" 
				LEFT JOIN links AS p2p ON links.type = "p2p" 
					AND links.peer_node_id = p2p.node_id 
					AND p2p.type = "p2p" 
					AND p2p.peer_node_id = links.node_id 
					AND p2p.status = "active" 
				LEFT JOIN links as aps ON links.type = "ap" 
					AND links.id = aps.id', $where, "ip_ranges.id" . ($having != '' ? ' HAVING (' . $having . ')' : ""), "ip_ranges.date_in DESC, ip_ranges.status ASC");
        $table_ip_ranges->db_data_search($form_search_ranges);
        foreach ((array) $table_ip_ranges->data as $key => $value) {
            if ($key != 0) {
                $table_ip_ranges->data[$key]['ip_start'] = long2ip($table_ip_ranges->data[$key]['ip_start']);
                $table_ip_ranges->data[$key]['ip_end'] = long2ip($table_ip_ranges->data[$key]['ip_end']);
                $table_ip_ranges->data[$key]['ip_range'] = $table_ip_ranges->data[$key]['ip_start'] . " - " . $table_ip_ranges->data[$key]['ip_end'];
            }
        }
        $table_ip_ranges->db_data_multichoice('ip_ranges', 'id');
        for ($i = 1; $i < count($table_ip_ranges->data); $i++) {
            if (isset($table_ip_ranges->data[$i])) {
                $table_ip_ranges->data[$i]['total_active_peers'] = ($table_ip_ranges->data[$i]['total_active_p2p'] > 0 ? $table_ip_ranges->data[$i]['total_active_p2p'] . " " . $lang['backbones_abbr'] : "") . ($table_ip_ranges->data[$i]['total_active_aps'] > 0 ? " + " . $table_ip_ranges->data[$i]['total_active_aps'] . " " . $lang['aps_abbr'] : "");
                $table_ip_ranges->info['EDIT'][$i] = make_ref('/hostmaster/range', array("iprange" => $table_ip_ranges->data[$i]['id']));
            }
        }
        $table_ip_ranges->info['EDIT_COLUMN'] = 'ip_range';
        $table_ip_ranges->info['MULTICHOICE_LABEL'] = 'delete';
        $table_ip_ranges->db_data_remove('id', 'ip_start', 'ip_end', 'total_active_p2p', 'total_active_aps');
        $table_ip_ranges->db_data_translate('ip_ranges__status', 'ip_ranges__delete_req');
        return $table_ip_ranges;
    }
开发者ID:southern-wind,项目名称:wind,代码行数:58,代码来源:hostmaster_ranges.php

示例10: output

 function output()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_' . $_POST['form_name'])) {
         return call_user_func(array($this, 'output_onpost_' . $_POST['form_name']));
     }
     global $construct;
     $this->tpl['form_search_dns'] = $construct->form($this->form_search_dns(), __FILE__);
     $this->tpl['table_dns'] = $construct->table($this->table_dns(), __FILE__);
     $this->tpl['link_schema'] = make_ref('/hostmaster/dnszones_schema');
     return template($this->tpl, __FILE__);
 }
开发者ID:southern-wind,项目名称:wind,代码行数:11,代码来源:hostmaster_dnszones.php

示例11: output

 function output()
 {
     global $main, $lang;
     $hostmaster_entry = $main->menu->main_menu->getRootEntry()->getChild('hostmaster');
     $hostmaster_entry->createLink($lang['ip_ranges'], make_ref('/hostmaster/ranges'));
     $hostmaster_entry->createLink($lang['ip_ranges_v6'], make_ref('/hostmaster/ranges_v6'));
     $hostmaster_entry->createLink($lang['dns_zones'], make_ref('/hostmaster/dnszones'));
     $hostmaster_entry->createLink($lang['db']['schema'], make_ref('/hostmaster/dnszones_schema'));
     $hostmaster_entry->createLink($lang['dns_nameservers'], make_ref('/hostmaster/dnsnameservers'));
     return $this->page->output();
 }
开发者ID:southern-wind,项目名称:wind,代码行数:11,代码来源:hostmaster.php

示例12: output

    function output()
    {
        global $db, $vars;
        $q = get('q');
        $widget = get('widget');
        if (isset($widget) && $widget == "true") {
            $this->tpl['widget'] = "1";
            $this->tpl['url'] = $vars['site']['url'];
            $this->limit = 5;
        } else {
            $this->tpl['widget'] = "0";
        }
        $i = 0;
        if (is_numeric($q) && strpos($q, ".") === FALSE) {
            $this->tpl['nodes_search'] = $db->get('nodes.id, nodes.name', 'nodes
										INNER JOIN users_nodes ON users_nodes.node_id = nodes.id
										INNER JOIN users ON users_nodes.user_id = users.id', 'users.status = "activated" AND nodes.id LIKE "' . replace_sql_wildcards($q) . '%"', 'nodes.id', 'nodes.id ASC', $this->limit);
            foreach ((array) $this->tpl['nodes_search'] as $key => $value) {
                $this->tpl['nodes_search'][$key]['href'] = make_ref("/nodes", array("node" => $this->tpl['nodes_search'][$key]['id']));
            }
        } elseif (is_ip($q, FALSE)) {
            $where = "(";
            $s_ranges = ip_to_ranges($q, FALSE);
            foreach ($s_ranges as $s_range) {
                $where .= "(ip_ranges.ip_start BETWEEN " . ip2long($s_range['min']) . " AND " . ip2long($s_range['max']) . ") OR ";
            }
            $where = substr($where, 0, -4) . ")";
            $this->tpl['ip_search'] = $db->get('ip_ranges.ip_start, nodes.id', 'ip_ranges
										LEFT JOIN nodes ON ip_ranges.node_id = nodes.id', $where, '', 'ip_ranges.status ASC, ip_ranges.ip_start ASC', $this->limit);
            foreach ((array) $this->tpl['ip_search'] as $key => $value) {
                $this->tpl['ip_search'][$key]['ip_start'] = long2ip($this->tpl['ip_search'][$key]['ip_start']);
                $this->tpl['ip_search'][$key]['href'] = make_ref("/nodes", array("node" => $this->tpl['ip_search'][$key]['id']));
            }
        } elseif (strpos($q, ".") !== FALSE && intval($q) == 0 || substr($q, -strlen("." . $vars['dns']['root_zone'])) == "." . $vars['dns']['root_zone']) {
            $this->tpl['dns_search'] = $db->get('dns_zones.name, dns_zones.type, nodes.id', 'dns_zones
										LEFT JOIN nodes ON dns_zones.node_id = nodes.id', 'dns_zones.name LIKE "' . replace_sql_wildcards(substr($q, 0, strrpos($q, "."))) . '"', '', 'dns_zones.status ASC, dns_zones.name ASC', $this->limit);
            foreach ((array) $this->tpl['dns_search'] as $key => $value) {
                if ($this->tpl['dns_search'][$key]['type'] == "forward") {
                    $this->tpl['dns_search'][$key]['name'] .= "." . $vars['dns']['root_zone'];
                }
                $this->tpl['dns_search'][$key]['href'] = make_ref('/nodes', array("node" => $this->tpl['dns_search'][$key]['id']));
            }
        } else {
            $this->tpl['nodes_search'] = $db->get('nodes.id, nodes.name', 'nodes
										INNER JOIN users_nodes ON users_nodes.node_id = nodes.id
										INNER JOIN users ON users_nodes.user_id = users.id', 'users.status = "activated" AND nodes.name LIKE "' . replace_sql_wildcards($q) . '%"', 'nodes.id', 'nodes.name ASC', $this->limit);
            foreach ((array) $this->tpl['nodes_search'] as $key => $value) {
                $this->tpl['nodes_search'][$key]['href'] = make_ref('/nodes', array("node" => $this->tpl['nodes_search'][$key]['id']));
            }
        }
        echo template($this->tpl, __FILE__);
        exit;
    }
开发者ID:southern-wind,项目名称:wind,代码行数:53,代码来源:search_suggest.php

示例13: output

 function output()
 {
     global $main, $lang;
     $admin_entry = $main->menu->main_menu->getRootEntry()->getChild('admin');
     $admin_entry->createLink($lang['nodes'], make_ref('/admin/nodes'));
     $admin_entry->createLink($lang['users'], make_ref('/admin/users'));
     $admin_entry->createLink($lang['services'], make_ref('/admin/nodes_services'));
     $admin_entry->createLink($lang['services_categories'], make_ref('/admin/services'));
     $admin_entry->createLink($lang['regions'], make_ref('/admin/regions'));
     $admin_entry->createLink($lang['areas'], make_ref('/admin/areas'));
     return $this->page->output();
 }
开发者ID:southern-wind,项目名称:wind,代码行数:12,代码来源:admin.php

示例14: output_onpost_form_services

 function output_onpost_form_services()
 {
     global $construct, $main, $db;
     $form_services = $this->form_services();
     $service = get('service');
     $ret = TRUE;
     $ret = $form_services->db_set(array(), "services", "id", get('service'));
     if ($ret) {
         $main->message->set_fromlang('info', 'insert_success', make_ref('/admin/services'));
     } else {
         $main->message->set_fromlang('error', 'generic');
     }
 }
开发者ID:southern-wind,项目名称:wind,代码行数:13,代码来源:admin_services_service.php

示例15: output

 function output()
 {
     global $main, $construct, $db;
     if (get('action') === "delete" && $main->userdata->privileges['admin'] === true) {
         $ret = $db->del("users", '', "id = '" . get('user') . "'");
         if ($ret) {
             $main->message->set_fromlang('info', 'delete_success', make_ref('/admin/users'));
         } else {
             $main->message->set_fromlang('error', 'generic');
         }
         return;
     } else {
         if (get('action') == 'activate') {
             $t = $db->get('account_code', 'users', "id = '" . get('user') . "'");
             if ($t[0]['account_code'] != '' && $t[0]['account_code'] == get('account_code')) {
                 $db->set('users', array('status' => 'activated'), "id = '" . get('user') . "'");
                 $main->message->set_fromlang('info', 'activation_success');
             } else {
                 $main->message->set_fromlang('error', 'activation_failed');
             }
             return;
         } else {
             if (get('action') == 'logout') {
                 $main->userdata->logout();
                 $redirect = get('redirect');
                 $redirect = $redirect == "" ? self_ref() : $redirect;
                 $main->message->set_fromlang('info', 'logout_success', $redirect);
                 return;
             } else {
                 if (get('action') == 'restore') {
                     return $this->restore->output();
                 }
             }
         }
     }
     if (get('subpage') == 'loginform') {
         $sp = new loginform();
         return $sp->output();
     }
     if ($_SERVER['REQUEST_METHOD'] == 'POST' && method_exists($this, 'output_onpost_' . $_POST['form_name'])) {
         return call_user_func(array($this, 'output_onpost_' . $_POST['form_name']));
     }
     if (get('user') != '') {
         $this->tpl['user_method'] = get('user') == 'add' ? 'add' : 'edit';
         if (get('user') != 'add' && $main->userdata->privileges['admin'] === true) {
             $this->tpl['link_user_delete'] = self_ref(array("action" => "delete"));
         }
         $this->tpl['form_user'] = $construct->form($this->form_user(), __FILE__);
     }
     return template($this->tpl, __FILE__);
 }
开发者ID:spinza,项目名称:wind,代码行数:51,代码来源:users.php


注:本文中的make_ref函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。