示例#1
0
 public function index()
 {
     if (IS_POST) {
         $post_data = I('post.');
         $post_data['first'] = $post_data['rows'] * ($post_data['page'] - 1);
         $map = array();
         $map = $this->_search();
         $total = $this->Model->where($map)->count();
         if ($total == 0) {
             $_list = '';
         } else {
             $_list = $this->Model->where($map)->order($post_data['sort'] . ' ' . $post_data['order'])->limit($post_data['first'] . ',' . $post_data['rows'])->select();
         }
         $option["status"] = array(0 => '禁用', 1 => '启用');
         foreach ($_list as $list_key => $list_one) {
             foreach ($list_one as $list_one_key => $list_one_field) {
                 if ($option[$list_one_key] != '') {
                     $_list[$list_key][$list_one_key] = $option[$list_one_key][$list_one_field];
                 }
             }
             $_list[$list_key]['action_title'] = get_action($_list[$list_key]['action_id'], 'title');
             $_list[$list_key]['user_nickname'] = get_nickname($_list[$list_key]['user_id']);
             $_list[$list_key]["create_time"] = date("Y年m月d日", $_list[$list_key]["create_time"]);
             $operate_menu = '';
             if (Is_Auth('Admin/ActionLog/edit')) {
                 $operate_menu = $operate_menu . "<a href='#' onclick=\"Submit_Form('ActionLog_Form','ActionLog_Data_List','" . U('edit', array('id' => $_list[$list_key]['id'])) . "','','编辑数据','');\">查看行为日志</a>";
             }
             $_list[$list_key]['operate'] = $operate_menu;
         }
         $data = array('total' => $total, 'rows' => $_list);
         $this->ajaxReturn($data);
     } else {
         $this->display();
     }
 }
function display_resource_action()
{
    $get_resource = display_data('resource');
    $display = '';
    $count_resource = 0;
    $count_action = 0;
    foreach ($get_resource as $value) {
        $count_resource++;
        $val = $value['resource'];
        $id = 'resource' . $value['id'];
        $display .= "<tr><td class='privilege_display'><label id='{$id}'\n        name='{$val}'>{$val}</label>&nbsp&nbsp</td> ";
        // Getting action table data.
        $get_action = get_action();
        foreach ($get_action as $value_action) {
            $count_action++;
            $val_action = $value_action['operation'];
            $id_action = $id . 'action' . $value_action['id'];
            $display .= "<td class='privilege_display'>\n            <input id='{$id_action}' type='checkbox' name='{$val_action}' value='{$val_action}'>\n            &nbsp{$val_action} &nbsp&nbsp </td> ";
        }
        if ($count_action >= 2) {
            $display .= "<td class='privilege_display'>\n            <input id='all_{$id}' type='checkbox' name='all' value='all_{$id}'>\n            &nbsp all &nbsp&nbsp </td> ";
        }
        $display .= '<br/> </tr>';
    }
    //end foreach
    $count_action /= 2;
    $display .= "<input id='count_action' type='hidden' name='count_action' value='{$count_action}'>";
    $display .= "<input id='count_resource' type='hidden' name='count_resource' value='{$count_resource}'>";
    return $display;
}
示例#3
0
文件: soundcloud.php 项目: obiloud/sc
function set_action($me)
{
    $time = time();
    $q = db('insert into actions (me, time) values (:me, :time)');
    $q->bindParam(':me', $me);
    $q->bindParam(':time', $time);
    $q->execute();
    get_action($me);
}
示例#4
0
 public function onBootstrap(MvcEvent $e)
 {
     $controller_id = (string) '';
     $action_id = (string) '';
     get_action($controller_id, $action_id);
     $eventManager = $e->getApplication()->getEventManager();
     $eventManager->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'onDispatchError'), 200);
     if (IS_TEST) {
         $this->loggingAccess($e->getRequest());
     }
     $this->createDbAdapter($e);
     $valid = $this->bootstrapSession($e);
     if (!$valid && 'failed' != $controller_id) {
         $this->toRoute = array('controller' => 'failed');
         session_destroy();
     } else {
         if ('failed' != $controller_id) {
             $this->auth = new AuthPlugin();
             $login = $this->auth->isLogin();
             if (RESTRICT_LOGIN) {
                 $user_no = $this->auth->get('user_no');
                 $storage = $e->getApplication()->getServiceManager()->get('Session\\Storage\\DbSessionStorage');
                 $storage->renewRestrictLogin($user_no);
             }
             if ($login && 'index' == $controller_id && ('index' == $action_id || !$action_id)) {
                 $this->toRoute = array('controller' => 'menu', 'action' => 'top');
             } else {
                 if (!$login && 'index' != $controller_id) {
                     $this->toRoute = array('controller' => 'index', 'action' => 'index');
                     $container = new ContainerPlugin();
                     $container->setContainer('index');
                     $uri = filter_input(INPUT_SERVER, "REQUEST_URI");
                     $container->set('uri', $uri);
                     $container->set('err_msg', 'セッションが切れました。');
                     // save request data
                     $p = $e->getRequest()->getPost()->toArray();
                     if (!$login && $this->toRoute && $p) {
                         $container->setContainer($controller_id);
                         $container->set('postRequest', json_encode($p));
                     }
                 }
             }
             $this->bootTranslator($e);
         }
     }
     $eventManager->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'), 100);
     if ($this->toRoute) {
         $eventManager->getSharedManager()->attach('Zend\\Mvc\\Controller\\AbstractActionController', 'dispatch', function ($e) {
             $controller = $e->getTarget();
             $controller->plugin('redirect')->toRoute('app', $this->toRoute);
         });
         return false;
     }
     $moduleRouteListener = new ModuleRouteListener();
     $moduleRouteListener->attach($eventManager);
 }
示例#5
0
function execute($app, $action)
{
    //传递进来的参数为空的话,才去获取URL的地址
    if (empty($app)) {
        $app = get_app();
    }
    if (empty($action)) {
        $action = get_action();
    }
    $new_action = $action . '_Action';
    $ac = new $new_action();
    $ac->execute();
}
/**
 * Prepare the action
 */
function prepare_action()
{
    global $_posted_params, $_action;
    global $_display_algorithm_descriptions, $_display_algorithm_categories, $_display_image;
    global $_algorithms, $_algorithm;
    $_posted_params = get_posted_params();
    $_action = get_action($_posted_params);
    $_display_algorithm_descriptions = empty($_COOKIE['_aa_no_algorithm_description']);
    $_display_algorithm_categories = empty($_COOKIE['_aa_no_algorithm_categories']);
    $_display_image = empty($_COOKIE['_aa_no_image']);
    $_algorithms = get_algorithms($_display_algorithm_descriptions);
    $_algorithm = get_algorithm($_posted_params, $_algorithms);
}
示例#7
0
文件: Crud.php 项目: moiseh/codegen
 public function onBeforeRender()
 {
     switch (get_action()) {
         case 'delete':
             $this->onDelete();
             break;
         case 'add':
         case 'edit':
             $this->add($this->getForm());
             break;
         default:
             $this->add($this->getView());
             break;
     }
 }
        } else {
            foreach ($__LIST__ as $key => $vo) {
                $mod = $i % 2;
                ++$i;
                ?>
<tr>
            <td><input class="ids" type="checkbox" name="ids[]" value="<?php 
                echo $vo["id"];
                ?>
" /></td>
			<td><?php 
                echo $vo["id"];
                ?>
 </td>
			<td><?php 
                echo get_action($vo['action_id'], 'title');
                ?>
</td>
			<td><?php 
                echo get_nickname($vo['user_id']);
                ?>
</td>
			<td><span><?php 
                echo time_format($vo["create_time"]);
                ?>
</span></td>
			<td><a href="<?php 
                echo U('Action/edit?id=' . $vo['id']);
                ?>
">详细</a>
				<a class="confirm ajax-get" href="<?php 
示例#9
0
 $date_relance = $level["level_min_date_relance"];
 $list_dates[$date_relance] = format_date($date_relance);
 if ($printed) {
     $list_dates_relance[$date_relance] = $list_dates[$date_relance];
     $dr = explode("-", $date_relance);
     $list_dates_sort[$date_relance] = mktime(0, 0, 0, $dr[1], $dr[2], $dr[0]);
 }
 //Tri des dates
 if (count($list_dates_sort)) {
     arsort($list_dates_sort);
 }
 print "<td>{$niveau_min}</td>";
 print "<td>" . $list_dates[$date_relance] . "</td>";
 print "<td>" . ($printed ? "x" : "") . "</td>";
 print "<td>{$niveau_normal}</td>";
 print "<td>" . get_action($r["id_empr"], $niveau_min, $niveau_normal) . "</td>";
 print "<td><input type='button' class='bouton_small' value='" . $msg["relance_row_valid"] . "' onClick=\"this.form.act.value='solo'; this.form.relance_solo.value='" . $r["id_empr"] . "'; {$script}\"/>&nbsp;";
 //Si mail de rappel affecté au responsable du groupe
 $requete = "select id_groupe,resp_groupe from groupe,empr_groupe where id_groupe=groupe_id and empr_id=" . $r["id_empr"] . " and resp_groupe and mail_rappel limit 1";
 $res = pmb_mysql_query($requete);
 if (pmb_mysql_num_rows($res) > 0) {
     $requete = "select id_empr, empr_mail from empr where id_empr='" . pmb_mysql_result($res, 0, 1) . "'";
     $result = pmb_mysql_query($requete);
     $has_mail = pmb_mysql_result($result, 0, 1) ? 1 : 0;
 } else {
     $has_mail = $r["empr_mail"] ? 1 : 0;
 }
 if ($niveau_min) {
     print "<input type='button' class='bouton_small' value='" . $msg["relance_row_print"] . "' onClick=\"openPopUp('pdf.php?pdfdoc=lettre_retard&id_empr=" . $r["id_empr"] . "&niveau=" . $niveau_min . "','lettre', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes'); this.form.act.value='solo_print'; this.form.relance_solo.value='" . $r["id_empr"] . "'; {$script}\"/>";
     if (($mailretard_priorite_email == 1 || $mailretard_priorite_email == 2) && $has_mail && ($niveau_min < 3 || $mailretard_priorite_email_3 == 1 && $niveau_min >= 3)) {
         print "<input type='button' class='bouton_small' value='" . $msg["relance_row_mail"] . "' onClick=\"this.form.act.value='solo_mail'; this.form.relance_solo.value='" . $r["id_empr"] . "'; {$script}\"/>";
示例#10
0
                // redirect back to homepage
                header("Location: http://www." . get_action(4));
                die;
            } else {
                $et->load("console")->fire_forget(get_action(3));
            }
            $ED->email = " Job received with action: " . get_action(3) . ". " . $the_callback_email . " will be notified once this job is completed.";
        } catch (Console_exception $e) {
            $ED->errors[] = $e->getMessage();
        }
        break;
    case "404":
        // import wikipedia article
        $ED->domain = get_action(3);
        $ED->topics = get_action(4);
        try {
            $ED->results = $et->load("wikipedia")->set_domain($ED->domain)->import($ED->topics);
        } catch (Wikipedia_exception $e) {
            $ED->errors[] = $e->getMessage();
        }
        break;
}
/**
 * Notify administrators.
 */
if (in_array(get_action(2), array("create", "quick", "suggest", "import", "404"))) {
    if (wp_mail($the_callback_email, "Ethach " . ucfirst(get_action()), json_encode($ED))) {
    }
    $ED->email = "Emailed sent.";
}
output_json($ED);
示例#11
0
 function MW_ActionRequest($http_request)
 {
     $name = $http_request->get_param(MW_REQVAR_ACTION);
     $this->action = $name !== null ? get_action($name) : get_default_action();
 }
示例#12
0
        echo '<div class="debug">' . htmlspecialchars('DEBUG: ' . $msg, ENT_NOQUOTES), "</div>\n";
    }
}
ini_set('include_path', ini_get('include_path') . ':.');
include 'miniwiki.php';
miniwiki_boot();
$req =& get_request("MW_PageRequest");
$page = $req->get_page();
set_current_page($page);
$auth =& get_auth();
if ($auth->is_invalid()) {
    add_info_text(_t('Invalid login.'));
}
$storage =& get_storage();
if (!$auth->is_logged && $storage->requires_login()) {
    $action = get_action(MW_ACTION_LOGIN);
    $action->handle();
}
$req =& get_request("MW_ActionRequest");
$action = $req->get_action();
if ($action === null) {
    trigger_error(_t("Unknown action."), E_USER_ERROR);
}
while ($action !== null) {
    if (!$action->is_valid()) {
        trigger_error(_t("Unknown action."), E_USER_ERROR);
        break;
    } elseif (!$action->is_permitted()) {
        add_info_text(_t('Insufficient user rights. Access denied to action: %0%', _t($action->get_name())));
        render_ui(MW_LAYOUT_HEADER);
        render_ui(MW_LAYOUT_FOOTER);
示例#13
0
# $Id$
# (c)2005,2006 Stepan Roh <*****@*****.**>
# Free to copy, free to modify, NO WARRANTY
/** @file
 * edit Wiki page
 */
$page =& get_current_page();
$req =& get_request("MW_EditRequest");
render_ui(MW_LAYOUT_HEADER, _t("Editing %0%", $page->name));
if ($req->is_preview() && $page->has_content) {
    echo '<div class="page-content">';
    $page->render();
    echo '</div>', "\n";
}
echo '<div class="page-edit">', "\n";
$action = get_action(MW_ACTION_EDIT);
$link = $action->link();
echo '<form method="post" action="', $link->to_url(true), '">', "\n";
/** generate edit button
 * label: button label
 * text: text inserted on current cursor position into textarea with id "editarea" if button is pressed
 *       % indicates where cursor should be positioned
 * accesskey: access key of this button (e.g. Alt-KEY in Mozilla Firefox) - defaults to nothing
 */
function generate_button($label, $text, $accesskey = '')
{
    echo '<button type="button"';
    if ($accesskey != '') {
        echo ' accesskey="', $accesskey, '"';
    }
    echo ' onclick="add_to_textarea(\'editarea\', \'', htmlspecialchars($text, ENT_QUOTES), '\')">', $label, '</button>', "\n";
示例#14
0
function wiki_include($page, $args = null, $flat_args = false, $as_current = true)
{
    $auth =& get_auth();
    if (!$auth->is_action_permitted(get_action(MW_ACTION_VIEW), $page)) {
        return '[[' . $page->name . ']]';
    }
    $ret = '{{&push_vars}}';
    if ($as_current) {
        $ret .= '{{&set|curpage|' . $page->name . '}}';
    }
    if ($args !== null && count($args) > 0) {
        $args_str = '';
        if ($flat_args) {
            $args_str = '|' . join('|', $args);
        } else {
            foreach ($args as $name => $value) {
                $args_str .= '|' . $name . '|' . $value;
            }
        }
        $ret .= '{{&set' . $args_str . '}}';
    }
    $ret .= str_replace("\r", '', $page->get_wiki_content());
    $ret .= '{{&pop_vars}}';
    return $ret;
}
示例#15
0
    <?php 
echo asset('Bits.css');
?>


    <!--[if IE]>
		<script src="http://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.1/html5shiv.js"></script>
	<![endif]-->

</head>
<body class="controller-<?php 
echo get_controller();
?>
 action-<?php 
echo get_action();
?>
">

<div id="auth" class="code-font">
	
	<header>
		<a href="http://coolbitsbro.com/"><span class="bit-embed"></span> Bits</a>
	</header>
	<?php 
if (isset($_GET['invalid'])) {
    ?>
<p>Invalid username or password</p><?php 
}
?>
<?php

$tabActive = "class='active'";
$userTab = get_action() == "edit_user" ? $tabActive : null;
$passwordTab = get_action() == "edit_password" ? $tabActive : null;
$securityTab = get_action() == "edit_security" ? $tabActive : null;
?>

<div>
    <ul class="nav nav-tabs tabnav">
        <li <?php 
echo $userTab;
?>
>
            <a href="<?php 
get_url('admin', 'edit_user', null, array('uid' => $username));
?>
 " >
                <?php 
echo _t('EDIT_PROFILE');
?>
            </a>
        </li>
        <li <?php 
echo $passwordTab;
?>
>
            <a  href="<?php 
get_url('admin', 'edit_password', null, array('uid' => $username));
?>
 " >
示例#17
0
                echo '<p>The calendar has already been installed. <a href="index.php">Installed calendar</a></p>';
                echo '<p>If you want to install again, manually delete config.php</p>';
                exit;
            }
        }
    }
}
echo '<p>Welcome to the PHP Calendar installation process.</p>
<form method="post" action="install.php">
';
foreach ($_POST as $key => $value) {
    echo "<input name=\"{$key}\" value=\"{$value}\" type=\"hidden\">\n";
}
$drop_tables = isset($_POST["drop_tables"]) && $_POST["drop_tables"] == "yes";
if (empty($_POST['action'])) {
    get_action();
} elseif ($_POST['action'] == 'upgrade') {
    if (empty($_POST['version'])) {
        get_upgrade_version();
    } else {
        if ($_POST['version'] == "2.0beta11") {
            upgrade_20beta11();
            echo "<p>Update complete.</p>";
        } elseif ($_POST['version'] == "2.0beta10") {
            upgrade_20beta10();
            echo "<p>Update complete.</p>";
        } elseif ($_POST['version'] == "2.0beta9") {
            upgrade_20beta10();
            echo "<p>Update complete.</p>";
            if (empty($_POST['timezone'])) {
                upgrade_20_form();
示例#18
0
 function &handle()
 {
     $page =& get_current_page();
     if ($page->load()) {
         if ($this->get_name() == MW_ACTION_VIEW_SOURCE) {
             include 'viewsource.php';
         } else {
             $req =& get_request("MW_ViewRequest");
             if ($req->get_redirect()) {
                 $redirected = array($page->name);
                 $redir_page = $page->get_redirected_page();
                 while ($redir_page !== null && $redir_page->load()) {
                     # those "labels" instead of "references" are real pain...
                     $_redir_page = $redir_page;
                     set_redirected_page($page);
                     set_current_page($_redir_page);
                     $redir_page = $redir_page->get_redirected_page();
                     if ($redir_page === null || in_array($redir_page->name, $redirected)) {
                         break;
                     }
                     array_unshift($redirected, $redir_page->name);
                 }
             }
             include 'viewpage.php';
         }
         $p = null;
         return $p;
     } else {
         if (is_a($page, 'MW_SpecialUploadPage') && $page->is_data_page) {
             # missing data page should raise 404 Not Found
             header("HTTP/1.0 404 Not Found");
         }
     }
     # fallback to edit if page does not exist
     return get_action(MW_ACTION_EDIT);
 }
示例#19
0
 /**
  * returns non-empty string if current user has permission on given action
  * for revision (set to revision variable if omitted; head means HEAD revision)
  * and page (set to page variable if omitted)
  */
 function wiki_fn_is_action_permitted($args, $renderer_state)
 {
     $action_name = array_shift($args);
     $revision = array_shift($args);
     if ($revision === null) {
         $revision = $renderer_state->wiki_variables->get('revision');
     }
     $page_name = array_shift($args);
     if ($page_name === null) {
         $page_name = $renderer_state->wiki_variables->get('page');
     }
     if ($revision == 'head') {
         $revision = MW_REVISION_HEAD;
     }
     $page = new_page($page_name, $revision);
     $auth =& get_auth();
     $action = get_action($action_name);
     return $action !== null && $auth->is_action_permitted($action, $page) ? 'true' : '';
 }
示例#20
0
echo get_action('lay_navigation', 'Navigation frame');
echo get_action('lay_tabs', 'Tabs');
echo get_action('lay_icons', 'Icons');
echo get_action('lay_browse', 'Browsing');
echo get_action('lay_edit', 'Editing');
echo get_action('lay_window', 'Query window');
echo '</fieldset>' . "\n\n";
echo '<fieldset class="toolbar"><legend>Features</legend>' . "\n";
echo get_action('feat_upload', 'Upload/Download');
echo get_action('feat_security', 'Security');
echo get_action('feat_manual', 'MySQL manual');
echo get_action('feat_charset', 'Charsets');
echo get_action('feat_extensions', 'Extensions');
echo get_action('feat_relation', 'MIME/Relation/History');
echo '</fieldset>' . "\n\n";
echo '<fieldset class="toolbar"><legend>Configuration</legend>' . "\n";
echo get_action('main', 'Overview');
echo get_action('display', 'Display');
echo get_action('download', 'Download');
echo get_action('save', 'Save', '', !$fail_dir);
echo get_action('load', 'Load', '', !$fail_dir);
echo get_action('clear', 'Clear');
echo get_action('seteol', 'Change end of line', '<select name="neweol">' . '<option value="unix" ' . ($_SESSION['eoltype'] == 'unix' ? ' selected="selected"' : '') . '>UNIX/Linux (\\n)</option>' . '<option value="dos" ' . ($_SESSION['eoltype'] == 'dos' ? ' selected="selected"' : '') . '>DOS/Windows (\\r\\n)</option>' . '<option value="mac" ' . ($_SESSION['eoltype'] == 'mac' ? ' selected="selected"' : '') . '>Macintosh (\\r)</option>' . '
        </select>');
echo '</fieldset>' . "\n\n";
echo '<fieldset class="toolbar"><legend>Other actions</legend>' . "\n";
echo get_action('versioncheck', 'Check for latest version');
echo get_url_action('http://www.phpmyadmin.net/', 'Go to homepage');
echo get_url_action('https://sourceforge.net/donate/index.php', 'Donate to phpMyAdmin', array('group_id' => 23067));
echo '</fieldset>' . "\n\n";
footer();
示例#21
0
文件: common.php 项目: RoyZeng/gtc
function get_action_title($id)
{
    return get_action($id, 'title');
}
function get_action()
{
    global $argv;
    return strtolower(trim($argv['1']));
}
function get_type()
{
    global $argv;
    return strtolower(trim($argv['2']));
}
###################################################################
# Main code
###################################################################
$agi = new AGI();
$exten = agi_get_variable("USER");
$action = get_action();
$type = get_type();
# VM exists?
if (check_for_voicemail_box($exten)) {
    # Retrieve Spooler directory
    $spool_dir = agi_get_variable('ASTSPOOLDIR');
    # Depending on message type
    switch ($type) {
        case 'temp':
            $play = 'vm-rec-temp';
            $file = $spool_dir . '/voicemail/default/' . $exten . '/temp';
            break;
        case 'name':
            $play = 'vm-rec-name';
            $file = $spool_dir . '/voicemail/default/' . $exten . '/greet';
            break;
	<div class="main-title cf">
		<h2>查看行为日志</h2>
	</div>

	<!-- 标签页导航 -->
	<div class="tab-wrap">
		<div class="tab-content">
			<!-- 表单 -->
			<form id="form" method="post" class="form-horizontal doc-modal-form">
				<!-- 基础 -->
				<div id="tab1" class="tab-pane in tab1">
					<div class="form-item cf">
						<label class="item-label">行为名称</label>
						<div class="controls">
							<span><?php 
echo get_action($info['action_id'], "title");
?>
</span>
						</div>
					</div>
					<div class="form-item cf">
						<label class="item-label">执行者</label>
						<div class="controls">
							<span><?php 
echo get_nickname($info['user_id']);
?>
</span>
						</div>
					</div>
					<div class="form-item cf">
						<label class="item-label">执行IP</label>