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


PHP Audit函数代码示例

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


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

示例1: array

            break;
    }
    $cols[] = $col;
    $col = array();
}
if ($_POST['tabletype'] != 'default') {
    $query['type'] = $_POST['tabletype'];
}
$query['comment'] = $_POST['comment'];
$query['cols'] = $cols;
if ($action == 'savetable') {
    System::database()->CreateTable($table, $query);
    Audit('Управление БД: Создание таблицы "' . $table . '"');
    GO(ADMIN_FILE . '?exe=dbadmin');
} elseif ($action == 'editsavetable') {
    $info = System::database()->GetTableInfo($table);
    $info = $info[0];
    System::database()->SetTableComment($table, $query['comment']);
    if (System::database()->Name == 'FilesDB') {
        System::database()->SetTableAutoIncrementIndex($table, $increment_index);
    }
    if (isset($query['type']) && strtoupper($info['type']) != strtoupper($query['type'])) {
        System::database()->SetTableType($table, $query['type']);
    }
    foreach ($query['cols'] as $i => $col) {
        System::database()->EditColl($table, $i, $col);
    }
    Audit('Управление БД: Редактирование структуры таблицы "' . $table . '"');
    GO(ADMIN_FILE . '?exe=dbadmin&a=structure&name=' . SafeEnv($_POST['tablename'], 250, str));
}
GO(ADMIN_FILE . '?exe=dbadmin');
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:31,代码来源:table_save.inc.php

示例2: DeletePost

    public function DeletePost($post_id = null, $first = true)
    {
        if ($post_id == null) {
            if (isset($_GET['post_id'])) {
                $post_id = $_GET['post_id'];
            }
        }
        if ($post_id != null) {
            System::database()->Select($this->PostsTable, "`id`='{$post_id}'");
            $post = System::database()->FetchRow();
        } else {
            $text = 'post_id нигде не инициализирована.';
            System::site()->AddTextBox('Ошибка.', '<p align="center">' . $text . '</p>');
            return 0;
        }
        if ($first) {
            if (System::user()->Auth) {
                $editing = System::user()->Get('u_id') == $post['user_id'] || System::user()->isAdmin();
            } else {
                $editing = $post['user_id'] == '0' && $post['user_ip'] == getip();
            }
            if (!$editing) {
                $text = 'У вас недостаточно прав для удаления этого сообщения.';
                System::site()->AddTextBox('Ошибка.', '<p align="center">' . $text . '</p>');
                return 0;
            }
        }
        if (!$first || isset($_GET['ok'])) {
            $del_count = 1;
            $parent_posts = System::database()->Select($this->PostsTable, "`post_parent_id`='{$post_id}'");
            foreach ($parent_posts as $post) {
                $del_count += $this->DeletePost(SafeDB($post['id'], 11, int), false);
            }
            System::database()->Delete($this->PostsTable, "`id`='{$post_id}'");
            if (System::user()->isAdmin()) {
                Audit('Posts: Удаление комментария "' . $this->PostsTable . '"/"' . "(user: {$post['user_name']}, object_id: {$post['object_id']})" . '"');
            }
            return $del_count;
        } else {
            $text = '<br />Удалить сообщение?<br /><br />' . '<a href="' . $this->DeletePageUrl . '&amp;post_id=' . $post_id . '&amp;ok=1">Да</a> &nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp; <a href="javascript:history.go(-1)">Нет</a><br /><br />';
            System::site()->AddTextBox('', '<p align="center">' . $text . '</p>');
            return 0;
        }
    }
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:45,代码来源:posts.class.php

示例3: SafeEnv

    exit;
}
$table = SafeEnv($_GET['name'], 255, str);
$index = SafeEnv($_GET['index'], 255, int);
$where = '';
$where_url = '';
if (isset($_GET['where'])) {
    $where = $_GET['where'];
    $where_url = '&where=' . $_GET['where'];
}
$rows = System::database()->Select($table, $where);
$row = $rows[$index];
$columns = System::database()->GetTableColumns($table);
$names = array();
foreach ($columns as $col) {
    $names[$col['name']] = $row[$col['name']];
}
$sql = '';
foreach ($row as $key => $value) {
    if (isset($names[$key])) {
        $sql .= "`" . $key . "`='" . System::database()->EscapeString($value) . "' and ";
    }
}
$sql = substr($sql, 0, strlen($sql) - 4);
System::database()->Delete($table, $sql);
Audit('Управление БД: Удаление строки из таблицы "' . $table . '"');
if (isset($_REQUEST['back'])) {
    GoRefererUrl($_REQUEST['back']);
} else {
    GO(ADMIN_FILE . '?exe=dbadmin&a=review&name=' . SafeDB($_GET['name'], 255, str) . $where_url);
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:31,代码来源:row_delete.inc.php

示例4: header

<?php

/*
 * LinkorCMS 1.4
 * © 2012 LinkorCMS Development Group
 */
if (!defined('VALID_RUN')) {
    header("HTTP/1.1 404 Not Found");
    exit;
}
if (isset($_POST['newname'])) {
    System::database()->RenameTable(SafeEnv($_GET['name'], 255, str), SafeEnv($_POST['newname'], 255, str));
    Audit('Управление БД: Переименование таблицы "' . $_GET['name'] . '" в "' . $_POST['newname'] . '"');
    GO(ADMIN_FILE . '?exe=dbadmin');
} else {
    AddCenterBox('Переименовать таблицу "' . SafeDB($_GET['name'], 255, str) . '"');
    FormRow('Новое имя', $site->Edit('newname', SafeDB($_GET['name'], 255, str), false, 'style="width: 210px;" class="autofocus"'));
    AddForm('<form action="' . ADMIN_FILE . '?exe=dbadmin&a=renametable&name=' . SafeEnv($_GET['name'], 255, str) . '" method="post">', $site->Button('Отмена', 'onclick="history.go(-1);"') . $site->Submit('Переименовать'));
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:19,代码来源:table_rename.inc.php

示例5: AdminConfigGroupDelete

function AdminConfigGroupDelete()
{
    $back_url = '';
    if (!AdminConfigPlugins()) {
        $back_url = ADMIN_FILE . '?exe=config_admin&a=view_groups&delok';
    } else {
        $back_url = ADMIN_FILE . '?exe=config_admin&a=view_groups_plugins&plugins=1&delok';
    }
    if (!isset($_GET['id'])) {
        GO($back_url);
    } else {
        $id = SafeEnv($_GET['id'], 11, int);
    }
    if (isset($_GET['ok']) && $_GET['ok'] == '1' || IsAjax()) {
        System::database()->Select(AdminConfigGroupTable(), "`id`='{$id}'");
        $conf = System::database()->FetchRow();
        System::database()->Delete(AdminConfigGroupTable(), "`id`='{$id}'");
        System::database()->Delete(AdminConfigConfigTable(), "`group_id`='{$id}'");
        Audit('Управление настройками: Удаление группы настроек "' . $conf['hname'] . '(' . $conf['name'] . ')" в "' . AdminConfigGroupTable() . '"');
        GO($back_url);
    } else {
        $r = System::database()->Select(AdminConfigGroupTable(), "`id`='{$id}'");
        AddCenterBox('Удаление группы навтроек');
        System::admin()->HighlightConfirm('Это может повлиять на работу системы. Нажмите отмена, если не уверены. Удалить группу настроек "' . SafeDB($r[0]['hname'], 255, str) . '"?', ADMIN_FILE . '?exe=config_admin&a=delete&id=' . $id . '&ok=1' . (AdminConfigPlugins() ? '&plugins=1' : ''));
    }
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:26,代码来源:admin.php

示例6: DeleteCat

 /**
  * Удаление категории
  * @param $Id
  * @return bool
  */
 public function DeleteCat($Id)
 {
     $cat = System::database()->SelectOne($this->Table, "`id`='{$Id}'");
     $childs = $this->GetAllChildId($Id);
     for ($i = 0, $c = count($childs); $i < $c; $i++) {
         System::database()->Delete($this->obj_table, "`{$this->obj_cat_coll}`='" . $childs[$i] . "'");
         System::database()->Delete($this->Table, "`id`='" . $childs[$i] . "'");
     }
     Audit('Категории: Удаление категории "' . $this->Table . '"/"' . $cat['title'] . '"');
     $this->CalcCatCounter($cat['parent'], false);
     System::cache()->Delete('tree', $this->Table);
     return true;
 }
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:18,代码来源:tree_a.class.php

示例7: AdminNewsTopicsDelete

function AdminNewsTopicsDelete()
{
    global $news_access_edittopics;
    if (!isset($_GET['id']) || !$news_access_edittopics) {
        exit('ERROR');
    }
    $id = SafeEnv($_GET['id'], 11, int);
    System::database()->Select('news_topics', "`id`='{$id}'");
    $topic = System::database()->FetchRow();
    $newsdb = System::database()->Select('news', "`topic_id`='{$id}'");
    foreach ($newsdb as $news) {
        System::database()->Delete('news_comments', '`object`=\'' . SafeEnv($news['id'], 11, int) . '\'');
    }
    System::database()->Delete('news', "`topic_id`='{$id}'");
    System::database()->Delete('news_topics', "`id`='{$id}'");
    AdminNewsClearBlockCache();
    Audit('Новости: Удаление новостного раздела "' . $topic['title'] . '"');
    exit('OK');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:19,代码来源:admin.php

示例8: AdminAuditClearReferers

function AdminAuditClearReferers()
{
    System::database()->Delete('referers', '');
    Audit('Аудит: Очистка лога рефералов');
    GO(ADMIN_FILE . '?exe=audit&a=referers');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:6,代码来源:admin.php

示例9: AdminSmiliesDeleteFile

function AdminSmiliesDeleteFile()
{
    global $smilies_dir, $mod;
    $name = $_GET['name'];
    unlink(RealPath2($smilies_dir . $name));
    Audit('Смайлики: Удаление файла смайлика ' . $smilies_dir . $name);
    GO($mod . '&a=auto');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:8,代码来源:admin.php

示例10: foreach

foreach ($columns as $col) {
    $values .= ",'" . SafeEnv($_POST[$col['name']], 0, str) . "'";
}
$values = substr($values, 1);
if ($action == 'insertsave') {
    // Добавление записи
    $db->Insert($table_name, $values);
} elseif ($action == 'editsave') {
    // Редактирование
    $index = SafeEnv($_GET['index'], 255, int);
    $where = '';
    if (isset($_GET['where'])) {
        $where = $_GET['where'];
    }
    $rows = $db->Select($table_name, $where);
    $old_values = $rows[$index];
    // Старые значения
    unset($rows);
    $where = '';
    foreach ($old_values as $key => $value) {
        $where .= "`" . $key . "`='" . SafeEnv($value, 0, str, false, true, false) . "' and ";
    }
    $where = substr($where, 0, -4);
    $db->Update($table_name, $values, $where, true);
    Audit('Управление БД: Удаление строки в таблице "' . $table_name . '"');
}
if (isset($_REQUEST['back'])) {
    GoRefererUrl($_REQUEST['back']);
} else {
    GO(ADMIN_FILE . '?exe=dbadmin&a=review&name=' . SafeDB($_GET['name'], 255, str));
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:31,代码来源:row_save.inc.php

示例11: AddCenterBox

<?php

/*
 * LinkorCMS 1.4
 * © 2012 LinkorCMS Development Group
 */
// Оптимизация всех таблиц БД
AddCenterBox('Оптимизация');
if (System::database()->Name != 'MySQL') {
    System::admin()->HighlightError('Только MySQL базы данных.');
    return;
}
$iferrors = false;
$tables = System::database()->GetTableInfo();
System::database()->MySQLQuery('LOCK TABLES');
foreach ($tables as $table) {
    $table = System::database()->Prefix() . $table['name'];
    if (System::database()->MySQLQuery('OPTIMIZE TABLE `' . $table . '`') == false) {
        System::admin()->HighlightError(System::database()->MySQLGetErrMsg() . ' (' . $table . ')');
        $iferrors = true;
    }
}
Audit('Управление БД: Оптимизация');
System::database()->MySQLQuery('UNLOCK TABLES');
if ($iferrors) {
    System::admin()->Highlight('Произошли ошибки при оптимизации некоторых таблиц.');
} else {
    System::admin()->Highlight('Все таблицы успешно оптимизированы.');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:29,代码来源:db_optimize.inc.php

示例12: AdminForumBasketRestore

function AdminForumBasketRestore()
{
    ForumLoadFunction('restore_basket');
    if (isset($_GET['forum_basket_post'])) {
        IndexForumRestoreBasketPost(SafeEnv($_GET['forum_basket_post'], 11, int));
        Audit('Форум: Восстановление сообщения из корзины');
    } elseif (isset($_GET['forum_basket_topics'])) {
        IndexForumRestoreBasketTopic(SafeEnv($_GET['forum_basket_topics'], 11, int));
        Audit('Форум: Восстановление темы из корзины');
    }
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:11,代码来源:admin.php

示例13: AdminFormsCheckAll

function AdminFormsCheckAll()
{
    if (!isset($_GET['id'])) {
        GO(ADMIN_FILE . '?exe=forms');
    }
    $form_id = SafeEnv($_GET['id'], 11, int);
    System::database()->Select('forms', "`id`='{$form_id}'");
    $form = System::database()->FetchRow();
    System::database()->Update('forms_data', "moderated='1'", "`form_id`='{$form_id}'");
    System::database()->Update('forms', "new_answ='0'", "`id`='{$form_id}'");
    Audit('Web-формы: Отметить все данные как прочитанные для формы "' . $form['hname'] . '"');
    GO(ADMIN_FILE . '?exe=forms');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:13,代码来源:admin.php

示例14: header

<?php

/*
 * LinkorCMS 1.4
 * © 2012 LinkorCMS Development Group
 */
if (!defined('VALID_RUN')) {
    header("HTTP/1.1 404 Not Found");
    exit;
}
if (isset($_GET['ok'])) {
    $ok = $_GET['ok'];
} else {
    $ok = false;
}
if ($ok) {
    System::database()->Truncate(SafeEnv($_GET['name'], 255, str));
    Audit('Управление БД: Очистка таблицы "' . $_GET['name'] . '"');
    GO(ADMIN_FILE . '?exe=dbadmin&a=review&name=' . SafeDB($_GET['name'], 255, str));
} else {
    $name = SafeDB($_GET['name'], 255, str);
    AddCenterBox('Очистка таблицы');
    System::admin()->HighlightConfirm('Вы действительно хотите очистить таблицу "' . $name . '" от записей?', ADMIN_FILE . '?exe=dbadmin&a=truncatetable&name=' . $name . '&ok=1');
    AdminFdbAdminGenTableMenu($name);
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:25,代码来源:table_truncate.inc.php

示例15: AdminUserDeleteAvatar

function AdminUserDeleteAvatar()
{
    if (isset($_GET['personal'])) {
        $dir = System::config('general/personal_avatars_dir');
        $personal = true;
    } else {
        $dir = System::config('general/avatars_dir');
        $personal = false;
    }
    $avatar = SafeEnv($_GET['filename'], 250, str);
    $filename = RealPath2($dir . $avatar);
    if (file_exists($filename) && is_file($filename)) {
        unlink($filename);
    }
    if ($personal) {
        System::database()->Update('users', "`a_personal`='0',`avatar`=''", "`a_personal`='1' and `avatar`='{$avatar}'");
    }
    Audit('Пользователи: Удаление аватара "' . $filename . '"');
    GO(ADMIN_FILE . '?exe=user&a=avatars');
}
开发者ID:agnyrussia,项目名称:linkorcms_mod_forms_file_support,代码行数:20,代码来源:admin.php


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