* @copyright   2007-2010 Rejo Zenger <*****@*****.**>
 * @copyright   2010-2014 Poweradmin Development Team
 * @license     http://opensource.org/licenses/GPL-3.0 GPL
 */
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$record_id = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
    $record_id = $_GET['id'];
}
$zone_templ_id = "-1";
if (isset($_GET['zone_templ_id']) && v_num($_GET['zone_templ_id'])) {
    $zone_templ_id = $_GET['zone_templ_id'];
}
$confirm = "-1";
if (isset($_GET['confirm']) && v_num($_GET['confirm'])) {
    $confirm = $_GET['confirm'];
}
if ($record_id == "-1" || $zone_templ_id == "-1") {
    error(ERR_INV_INPUT);
} else {
    $owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
    if ($confirm == '1' && $owner) {
        if (delete_zone_templ_record($record_id)) {
            success(SUC_RECORD_DEL);
        }
    } else {
        $templ_details = get_zone_templ_details($zone_templ_id);
        $record_info = get_zone_templ_record_from_id($record_id);
        echo "     <h2>" . _('Delete record in zone') . " \"" . $templ_details['name'] . "\"</h2>\n";
        if (!do_hook('verify_permission', 'zone_master_add') || !$owner) {
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
echo "  <script type=\"text/javascript\" src=\"inc/helper.js\"></script>";
$owner = "-1";
if (isset($_POST['owner']) && v_num($_POST['owner'])) {
    $owner = $_POST['owner'];
}
$dom_type = "NATIVE";
if (isset($_POST["dom_type"]) && in_array($_POST['dom_type'], $server_types)) {
    $dom_type = $_POST["dom_type"];
}
if (isset($_POST['domain'])) {
    $temp = array();
    foreach ($_POST['domain'] as $domain) {
        if ($domain != "") {
            $temp[] = trim($domain);
        }
    }
    $domains = $temp;
} else {
Beispiel #3
0
 *
 */
/**
 * Script that handles editing of zone records
 *
 * @package     Poweradmin
 * @copyright   2007-2010 Rejo Zenger <*****@*****.**>
 * @copyright   2010-2014 Poweradmin Development Team
 * @license     http://opensource.org/licenses/GPL-3.0 GPL
 */
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
include_once "inc/RecordLog.class.php";
global $pdnssec_use;
$zone_id = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
    $zone_id = $_GET['id'];
}
if ($zone_id == "-1") {
    error(ERR_INV_INPUT);
    include_once "inc/footer.inc.php";
    exit;
}
if (isset($_POST['commit'])) {
    $error = false;
    $one_record_changed = false;
    if (isset($_POST['record'])) {
        foreach ($_POST['record'] as $record) {
            $old_record_info = get_record_from_id($record['rid']);
            // Check if a record changed and save the state
            $log = new RecordLog();
Beispiel #4
0
function get_user_detail_list($specific)
{
    global $db;
    $userid = $_SESSION['userid'];
    if (v_num($specific)) {
        $sql_add = "AND users.id = " . $db->quote($specific, 'integer');
    } else {
        if (verify_permission('user_view_others')) {
            $sql_add = "";
        } else {
            $sql_add = "AND users.id = " . $db->quote($userid, 'integer');
        }
    }
    $query = "SELECT users.id AS uid, \n\t\t\tusername, \n\t\t\tfullname, \n\t\t\temail, \n\t\t\tdescription AS descr,\n\t\t\tactive,\n\t\t\tperm_templ.id AS tpl_id,\n\t\t\tperm_templ.name AS tpl_name,\n\t\t\tperm_templ.descr AS tpl_descr\n\t\t\tFROM users, perm_templ \n\t\t\tWHERE users.perm_templ = perm_templ.id " . $sql_add . "\n\t\t\tORDER BY username";
    $response = $db->query($query);
    if (PEAR::isError($response)) {
        error($response->getMessage());
        return false;
    }
    while ($user = $response->fetchRow()) {
        $userlist[] = array("uid" => $user['uid'], "username" => $user['username'], "fullname" => $user['fullname'], "email" => $user['email'], "descr" => $user['descr'], "active" => $user['active'], "tpl_id" => $user['tpl_id'], "tpl_name" => $user['tpl_name'], "tpl_descr" => $user['tpl_descr']);
    }
    return $userlist;
}
/**
 * Script that handles records editing in zone templates
 *
 * @package     Poweradmin
 * @copyright   2007-2010 Rejo Zenger <*****@*****.**>
 * @copyright   2010-2014 Poweradmin Development Team
 * @license     http://opensource.org/licenses/GPL-3.0 GPL
 */
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$record_id = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
    $record_id = $_GET['id'];
}
$zone_templ_id = "-1";
if (isset($_GET['zone_templ_id']) && v_num($_GET['zone_templ_id'])) {
    $zone_templ_id = $_GET['zone_templ_id'];
}
$owner = get_zone_templ_is_owner($zone_templ_id, $_SESSION['userid']);
if (isset($_POST["commit"])) {
    if (!do_hook('verify_permission', 'zone_master_add') || !$owner) {
        error(ERR_PERM_EDIT_RECORD);
    } else {
        $ret_val = edit_zone_templ_record($_POST);
        if ($ret_val == "1") {
            success(SUC_RECORD_UPD);
        } else {
            echo "     <div class=\"error\">" . $ret_val . "</div>\n";
        }
    }
}
Beispiel #6
0
    $perm_meta_edit = "none";
}
/*
 Check and make sure all post values have made it through
 if not set them.
*/
$zone_id = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
    $zone_id = $_GET['id'];
}
$ttl = $dns_ttl;
if (isset($_POST['ttl']) && v_num($_POST['ttl'])) {
    $ttl = $_POST['ttl'];
}
$prio = "10";
if (isset($_POST['prio']) && v_num($_POST['prio'])) {
    $prio = $_POST['prio'];
}
if (isset($_POST['name'])) {
    $name = $_POST['name'];
} else {
    $name = "";
}
if (isset($_POST['type'])) {
    $type = $_POST['type'];
} else {
    $type = "";
}
if (isset($_POST['content'])) {
    $content = $_POST['content'];
} else {
Beispiel #7
0
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
require_once "inc/toolkit.inc.php";
include_once "inc/header.inc.php";
$id = "-1";
if (isset($_GET['id']) || v_num($_GET['id'])) {
    $id = $_GET['id'];
}
if ($id == "-1") {
    error(ERR_INV_INPUT);
} elseif (!verify_permission('templ_perm_edit')) {
    error(ERR_PERM_EDIT_PERM_TEMPL);
} else {
    $id = $_GET['id'];
    if (isset($_POST['commit'])) {
        update_perm_templ_details($_POST);
    }
    $templ = get_permission_template_details($id);
    $perms_templ = get_permissions_by_template_id($id);
    $perms_avail = get_permissions_by_template_id();
    echo "    <h2>" . _('Edit permission template') . "</h2>\n";
Beispiel #8
0
 if (isset($_POST['fullname'])) {
     $i_fullname = $_POST['fullname'];
 }
 if (isset($_POST['email'])) {
     $i_email = $_POST['email'];
 }
 if (isset($_POST['description'])) {
     $i_description = $_POST['description'];
 }
 if (isset($_POST['password'])) {
     $i_password = $_POST['password'];
 }
 if (isset($_POST['perm_templ']) && v_num($_POST['perm_templ'])) {
     $i_perm_templ = $_POST['perm_templ'];
 }
 if (isset($_POST['active']) && v_num($_POST['active'])) {
     $i_active = $_POST['active'];
 }
 if ($i_username == "-1" || $i_fullname == "-1" || $i_email < "1" || $i_description == "-1" || $i_password == "-1") {
     error(ERR_INV_INPUT);
 } else {
     if ($i_username != "" && $i_perm_templ > "0" && $i_fullname) {
         if (!isset($i_active)) {
             $active = 0;
         } else {
             $active = 1;
         }
         if (edit_user($edit_id, $i_username, $i_fullname, $i_email, $i_perm_templ, $i_description, $active, $i_password)) {
             success(SUC_USER_UPD);
         }
     }
Beispiel #9
0
    $perm_meta_edit = "all";
} elseif (verify_permission('zone_meta_edit_own')) {
    $perm_meta_edit = "own";
} else {
    $perm_meta_edit = "none";
}
$zone_id = "-1";
if (isset($_GET['id']) && v_num($_GET['id'])) {
    $zone_id = $_GET['id'];
}
$ttl = $dns_ttl;
if (isset($_POST['ttl']) && v_num($_POST['ttl'])) {
    $ttl = $_POST['ttl'];
}
$prio = "10";
if (isset($_GET['prio']) && v_num($_GET['prio'])) {
    $prio = $_GET['prio'];
}
if (isset($_POST['name'])) {
    $name = $_POST['name'];
} else {
    $name = "";
}
if (isset($_POST['type'])) {
    $type = $_POST['type'];
} else {
    $type = "";
}
if (isset($_POST['content'])) {
    $content = $_POST['content'];
} else {