示例#1
0
文件: edit.php 项目: sQcrm/sqcrm
<?php

// Copyright SQCRM. For licensing, reuse, modification and distribution see license.txt
/**
* CustomView edit 
* @author Abhik Chakraborty
*/
$do_edit = true;
if (isset($_REQUEST["sqrecord"]) && (int) $_REQUEST["sqrecord"] > 0) {
    $module_obj = new CustomView();
    $module_obj->getId($_REQUEST["sqrecord"]);
    if ($module_obj->getNumRows() > 0) {
        if ($module_obj->iduser != $_SESSION["do_user"]->iduser) {
            $do_edit = false;
        }
        if ($module_obj->is_editable == 0) {
            $do_edit = false;
        }
    } else {
        $do_edit = false;
    }
} else {
    $do_edit = false;
}
if ($do_edit === false) {
    echo '<div class="alert alert-error alert-block" style="height:100px;margin-top:100px;margin-left:200px;margin-right:200px;">';
    echo '<h4>';
    echo _('Access Denied ! ');
    echo '</h4>';
    echo _('You are not authorized to perform this operation.');
    echo '</div>';