• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP myError函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Update_Resource_Template

 function Update_Resource_Template($siteid, $lists)
 {
     $this->_debug("Update_Resource_Template....");
     $ctype = 'RES';
     $qry = "DELETE FROM {$this->tbl} WHERE siteid='{$siteid}' AND ctype='{$ctype}'";
     $this->_debug($qry);
     $ret = myQuery($qry);
     foreach ($lists as $uri) {
         list($prefix, $uuid) = preg_split("/#/", $uri);
         //$flag = false;
         //if (preg_match("/os_tpl/", $prefix)) $flag = true;
         //if (preg_match("/template.os/", $prefix)) $flag = true;
         //if (!$flag) continue;
         $s = array();
         $s[] = "siteid='{$siteid}'";
         $s[] = "uri='{$uri}'";
         $s[] = "hash='{$hash}'";
         $s[] = "ctype='{$ctype}'";
         $s[] = "idate=now()";
         $s[] = "udate=now()";
         $sql_set = " SET " . join(",", $s);
         $qry = "INSERT INTO {$this->tbl} {$sql_set}";
         $ret = myQuery($qry);
         $err = myError();
         if ($err) {
             print $qry . $err;
         }
     }
 }
开发者ID:swkim85,项目名称:EGIFedCloudWeb,代码行数:29,代码来源:func.occi.php


示例2: _insert_vminfo

function _insert_vminfo($siteid, $osid, $resid, $name, $vmurl, $title)
{
    $qry = "INSERT INTO vminfo" . " SET siteid='{$siteid}', osid='{$osid}', resid='{$resid}', vmname='{$name}', vmurl='{$vmurl}', title='{$title}', createTime=NOW()";
    //dd($qry);
    $ret = myQuery($qry);
    print myError();
}
开发者ID:swkim85,项目名称:EGIFedCloudWeb,代码行数:7,代码来源:create.php


示例3: GetRoutingTable

function GetRoutingTable($host, $community, $rtrtype)
{
    global $w, $p;
    $OID = array("generic" => ".1.3.6.1.2.1.4.21.1.11", "riverstone" => ".1.3.6.1.2.1.4.24.4", "juniper" => ".1.3.6.1.2.1.4.24.4.1");
    if (!extension_loaded("snmp")) {
        myError($w, $p, "no snmp!!! - compile php with --with-snmp --enable-ucd-snmp-hack");
        exit;
    }
    if (strpos(strtoupper(PHP_OS), 'WIN') !== false) {
        // Windows snmp different
    } else {
        // Unix snmp different - need to set quickprint to be compatible
        // with Windows format. Windows does not have long print format
        // must test for os version as undefined function generates error
        // even with @
        snmp_set_quick_print(1);
    }
    // protect against bad users!
    if (!array_key_exists($rtrtype, $OID)) {
        $rtrtype = "generic";
    }
    $routes = @snmpwalkoid($host, $community, $OID[$rtrtype]);
    if (!$routes) {
        return 0;
    }
    for (reset($routes); $network = key($routes); next($routes)) {
        //here is the way to do it with RFC 2096 using ipCidrRouteMask
        //this is what we get back from the riverstone
        //meaning:  subnet IP, subnet mask, destination = ip destination ip
        if ($rtrtype == "riverstone") {
            //kill the destination
            list($oc1, $oc2, $oc3, $oc4, $oc5, $rest) = explode(".", strrev($network), 6);
            //take the subnetmask
            list($oc1, $oc2, $oc3, $oc4, $rest) = explode(".", $rest, 5);
            $mask = strrev(sprintf("%s.%s.%s.%s", $oc1, $oc2, $oc3, $oc4));
            //take the subnet addr
            list($oc1, $oc2, $oc3, $oc4, $rest) = explode(".", $rest, 5);
            $netaddr = strrev(sprintf("%s.%s.%s.%s", $oc1, $oc2, $oc3, $oc4));
        } else {
            // The Old way to do it with RFC 1213 MIBv2 (which is deprecated)
            // do some magic to obtain a unique, sortable array index to force the results
            // into ip address order. index will be x0000000000 where the digits are the
            // integer representation of the ip address padded with zeros.
            $mask = $routes[$network];
            // strip out last 4 octets from mib value - lots of .'s
            // complicate matters
            list($oc1, $oc2, $oc3, $oc4, $rest) = explode(".", strrev($network), 5);
            $netaddr = strrev(sprintf("%s.%s.%s.%s", $oc1, $oc2, $oc3, $oc4));
        }
        // $ind='x'.str_pad(inet_aton(substr($netaddr, strpos($netaddr, '.')+1)), 10, "0", STR_PAD_LEFT);
        $ind = 'x' . str_pad(inet_aton($netaddr), 10, "0", STR_PAD_LEFT);
        $result["{$ind}"] = array("rtrbase" => $netaddr, "rtrmask" => $mask);
    }
    //"rtrmask"=>substr($mask, strpos($mask, ' ')+1));
    return $result;
}
开发者ID:hetznerZA,项目名称:ipplan,代码行数:56,代码来源:displayrouter.php


示例4: isset

// set language
isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']);
//setdefault("window",array("bgcolor"=>"white"));
$title = my_("Delete customer/autonomous system results");
newhtml($p);
$w = myheading($p, $title, true);
// explicitly cast variables as security measure against SQL injection
list($cust) = myRegister("I:cust");
if (!$_GET) {
    myError($w, $p, my_("You cannot reload or bookmark this page!"));
}
// basic sequence is connect, search, interpret search
// result, close connection
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
if (!$ds->TestCustomerCreate(getAuthUsername())) {
    myError($w, $p, my_("You may not delete customers as you are not a member a group that can delete customers"));
}
// check if customer has subnets assigned
$result =& $ds->ds->SelectLimit("SELECT baseaddr, descrip\n                           FROM base\n                           WHERE customer={$cust}\n                           ORDER BY baseaddr", 100);
if ($row = $result->FetchRow()) {
    insert($w, text(my_("Cannot delete customer because the following subnets are assigned to the customer (limited to first 100):")));
    insert($w, block("<p>"));
    // create a table
    insert($w, $t = table(array("cols" => "2", "class" => "outputtable")));
    // draw heading
    setdefault("cell", array("class" => "heading"));
    insert($t, $c = cell());
    insert($c, text(my_("Base address")));
    insert($t, $c = cell());
    insert($c, text(my_("Subnet description")));
    do {
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:deletecustomer.php


示例5: insert

// display opening text
insert($w, heading(3, "{$title}."));
insert($w, block("<br>" . my_("Import IP details data in XML format. The data is in the same format generated by <a HREF=\"http://www.insecure.org\">NMAP's</a> -oX parameter. This is useful to scan and obtain records for sites that have no previous information.")));
insert($w, block("<p>"));
insert($w, text(my_("Import IP details data from flat ascii files.  The file should contain a minimum of seven columns each delimited by TAB: ")));
insert($w, text(my_("The columns are imported in the following order: IP address, user, location, description, hostname, telephone number and mac address.")));
insert($w, block("<p>"));
insert($w, text(my_("If the import file has more than seven columns, each additional column will be added to the user defined fields defined in the iptemplate.xml file in the order specified in the template.")));
insert($w, block("<p>"));
insert($w, text(my_("If an error occurs during the import, the process will stop. Records that have been successfully imported should be deleted from the import file, the error corrected and the import resumed.")));
insert($w, block("<p>"));
insert($w, text(my_("NOTE: Any number of IP address records for various subnets can be in the file.  Any existing information will be overwritten.") . " "));
insert($w, text(my_("Imported addresses will only be added to existing subnets.") . " "));
insert($w, textbr(my_("If the merge flag is set, any fields that are empty or contain NULL will not be overwritten.")));
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
// start form
insert($w, $f = form(array("method" => "post", "enctype" => "multipart/form-data", "action" => "importip.php")));
$cust = myCustomerDropDown($ds, $f, 0, 0, FALSE) or myError($w, $p, my_("No customers"));
insert($f, textbrbr(my_("File name")));
insert($f, hidden(array("name" => "MAX_FILE_SIZE", "value" => MAXUPLOADSIZE)));
insert($f, inputfile(array("name" => "userfile")));
insert($f, textbrbr(my_("Format")));
insert($f, selectbox(array("text" => my_("Standard fields - text format"), "xml" => my_("Standard fields - NMAP XML format")), array("name" => "format")));
insert($f, generic("br"));
insert($f, generic("br"));
insert($f, checkbox(array("NAME" => "append"), " " . my_("Merge"), $c = ""));
insert($f, generic("br"));
insert($f, generic("br"));
insert($f, submit(array("value" => my_("Submit"))));
insert($f, freset(array("value" => my_("Clear"))));
printhtml($p);
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:importipform.php


示例6: getAuthUsername

            $userid = getAuthUsername();
        }
        $password = crypt($password1, 'xq');
        $ds->DbfTransactionStart();
        $result =& $ds->ds->Execute("UPDATE users\n                              SET password=" . $ds->ds->qstr($password) . "\n                              WHERE userid=" . $ds->ds->qstr($userid));
        $ds->AuditLog(sprintf(my_("User %s changed password"), $userid));
        if ($result) {
            $ds->DbfTransactionEnd();
            insert($w, text(my_("Password changed")));
        } else {
            $formerror .= my_("Password could not be changed") . "\n";
        }
    }
}
if (!$_POST || $formerror) {
    myError($w, $p, $formerror, FALSE);
    if ($user) {
        insert($w, heading(3, sprintf(my_("Change password for user %s"), $user)));
    } else {
        insert($w, heading(3, sprintf(my_("Change password for user %s"), getAuthUsername())));
    }
    // start form
    insert($w, $f = form(array("method" => "post", "action" => $_SERVER["PHP_SELF"])));
    insert($f, $con = container("fieldset", array("class" => "fieldset")));
    insert($con, $legend = container("legend", array("class" => "legend")));
    insert($legend, text($title));
    // display opening text
    if ($user) {
        insert($con, hidden(array("name" => "user", "value" => "{$user}")));
    }
    insert($con, textbr(my_("New password (case sensitive!):")));
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:changepassword.php


示例7: controller

function controller($user, $request, $response)
{
    try {
        $functions = array('login', 'connect', 'sendMove', 'win');
        $data = json_decode($request, true);
        if (empty($data)) {
            myError($user, $request, $response, 'invalidJSON');
        } else {
            if (!in_array($data['funct'], $functions)) {
                myError($user, $request, $response, 'notFound');
            } else {
                call_user_func($data['funct'], $user, $data, $response);
            }
        }
    } catch (Exception $e) {
        myError($user, $request, $response, 'unknownError');
    }
}
开发者ID:kperson,项目名称:Connect4-Websockets,代码行数:18,代码来源:server.php


示例8: insert

    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&domain=" . urlencode($domain) . "&cust=" . $cust . "&expr={$expr}&descrip=" . urlencode($descrip), "domain");
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
insert($w, block("<p>"));
if ($cnt) {
    insert($w, anchor($_SERVER["PHP_SELF"] . "?cust={$cust}&dataid=0&action=export", my_("Export all changed DNS Zones"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure to Export?") . "')") : FALSE));
} else {
    myError($w, $p, my_("Search found no DNS Zone entries"), FALSE);
}
insert($w, $f = form(array("method" => "post", "action" => "modifydnsform.php?cust={$cust}&action=add")));
insert($f, submit(array("value" => my_("Add a DNS Zone"))));
$result->Close();
// create the export view form
$expression = $export->translateExpr($expr);
$export->setInfo(array(array("customer_ID", "customer_description", "search_criterion", "search_expression"), array($cust, $ds->getCustomerDescrip($cust), $expression, $descrip)));
$export->createExportForm($w, $template);
printhtml($p);
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:modifydns.php


示例9: _update_vm_status

}
function _update_vm_status($id, $stat)
{
    $qry = "UPDATE vminfo SET state='{$stat}' WHERE id='{$id}'";
    $ret = myQuery($qry);
}
### }}}
### {{{
if ($mode == 'do_change_name') {
    $id = $form['id'];
    $vmname = $form['vmname'];
    $memo = $form['memo'];
    $memo = myEscapeString($memo);
    $qry = "UPDATE vminfo SET vmname='{$vmname}', memo='{$memo}' where id='{$id}'";
    $ret = myQuery($qry);
    print myError();
    print <<<EOS
<script>
window.opener.document.location.reload();
window.close();
</script>
EOS;
    exit;
}
if ($mode == 'change_name') {
    $id = $form['id'];
    $row = _query_vm($id);
    //dd($row);
    pagehead($pgtitle, true);
    ParagraphTitle("VM Information");
    ParagraphTitle("Change Name", 1);
开发者ID:swkim85,项目名称:EGIFedCloudWeb,代码行数:31,代码来源:vmlist.php


示例10: insert

    insert($c, block("</small>"));
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&zone=" . urlencode($zone) . "&cust=" . $cust . "&expr={$expr}&descrip=" . urlencode($descrip), "zone");
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
if ($cnt) {
    insert($w, anchor($_SERVER["PHP_SELF"] . "?cust={$cust}&zoneid=0&action=export", my_("Export all changed DNS Zones"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure to Export?") . "')") : FALSE));
} else {
    myError($w, $p, my_("Search found no Zone entries") . "\n", FALSE);
}
insert($w, $f = form(array("method" => "post", "action" => "modifyzoneform.php?cust={$cust}&action=add")));
insert($f, submit(array("value" => my_("Add a Zone"))));
$result->Close();
// create the export view form
$expression = $export->translateExpr($expr);
$export->setInfo(array(array("customer_ID", "customer_description", "search_criterion", "search_expression"), array($cust, $ds->getCustomerDescrip($cust), $expression, $descrip)));
$export->createExportForm($w, NULL);
printhtml($p);
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:modifyzone.php


示例11: SQLAuthenticator

$auth = new SQLAuthenticator(REALM, REALMERROR);
// And now perform the authentication
$auth->authenticate();
// set language
isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']);
//setdefault("window",array("bgcolor"=>"white"));
$title = my_("Ping results");
newhtml($p);
$w = myheading($p, $title, true);
// explicitly cast variables as security measure against SQL injection
list($lookup) = myRegister("S:lookup");
if (!$_GET) {
    myError($w, $p, my_("You cannot reload or bookmark this page!"));
}
if (testIP($lookup)) {
    myError($w, $p, my_("Invalid IP address"));
}
function callback($buffer)
{
    return $buffer;
}
// need to print at this stage as display data is cached via layout template
// buffer the output and do some tricks to place system call output in correct
// place
ob_start("callback");
printhtml($p);
$buf = ob_get_contents();
ob_end_clean();
// now print first half of HTML to browser - split at start of "normalbox"
list($beg, $end) = spliti('CLASS="normalbox">', $buf);
echo $beg;
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:ping.php


示例12: insert

$mid->setImgdir('../menus/menuimages/');
$mid->setImgwww('../menus/menuimages/');
$mid->setIcondir('../menus/menuicons/');
$mid->setIconwww('../menus/menuicons/');
$mid->SetMenuStructureString($MENU);
$mid->setIconsize(16, 16);
$mid->parseStructureForMenu('treemenu1');
$mid->newTreeMenu('treemenu1');
insert($view, block($mid->getTreeMenu('treemenu1')));
insert($view, block('<br><br>'));
// If any of the parsing generates an error, we insert that error and then reinsert the form that generated the error.
// The two group functions can come from multiple forms so we don't bother.
// Since all the possible inputs are generated by the code this should rarely happen anyways
// (assuming this is all bug free ;)
if ($formerror != "") {
    myError($editor, $p, $formerror, FALSE);
    if ($action == "parsecreateuserform") {
        insertCreateUserForm($editor, $ds);
    }
    if ($action == "parsecreategroupform") {
        insertCreateGroupForm($editor, $ds);
    }
    if ($action == "deleteuser") {
        insertEditUserForm($editor, $ds);
    }
    if ($action == "deletegroup") {
        insetrEditGroupForm($editor, $ds);
    }
    if ($action == "deleteuserfromgroup") {
        /* done in function with ref var */
    }
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:usermanager.php


示例13: insert

 insert($t, $c = cell());
 insert($c, text($row["location"]));
 $export->addCell($row["location"]);
 insert($t, $c = cell());
 insert($c, block(linkURL(htmlspecialchars($row["descrip"]))));
 $export->addCell($row["descrip"]);
 if ($showdns) {
     // gethostbyaddr returns ip address back if no DNS entry
     // this will probably fail on windows!
     $tmp = time();
     $dnsdescrip = gethostbyaddr($ip);
     // are DNS queries taking too long?
     if (time() - $tmp > DNS_DELTA_TIME) {
         $showdns = 0;
         // stop doing DNS queries
         myError($w, $p, sprintf(my_("DNS queries taking too long - stopped doing queries at %s, time taken for last query was %s seconds"), $ip, time() - $tmp), FALSE);
     }
     if ($dnsdescrip != $ip and $dnsdescrip != $row["hname"]) {
         if (!empty($row["descrip"])) {
             insert($c, textbr());
         }
         insert($c, text($dnsdescrip, array("color" => "#FF0000")));
     } else {
         if ($dnsdescrip == $ip and !empty($row["hname"])) {
             if (!empty($row["descrip"])) {
                 insert($c, textbr());
             }
             insert($c, text(my_("No DNS entry defined"), array("color" => "#FF0000")));
         }
     }
 }
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:displaysubnet.php


示例14: myErrorException

function myErrorException($e)
{
    // Redirect to the error Handler
    myError(18000, $e->getMessage(), $e->getFile(), $e->getLine(), $e->getTrace());
}
开发者ID:Nikya,项目名称:voicify,代码行数:5,代码来源:control.php


示例15: gethostbyaddr

                    // remember to skip broadcast and network addresses!
                    for ($i_dns = 1; $i_dns < $size - 1; $i_dns++) {
                        $hname = gethostbyaddr(inet_ntoa($base + $i_dns));
                        if ($hname != inet_ntoa($base + $i_dns)) {
                            $ds->AddIP($base + $i_dns, $id, "", "", "", "", "", $hname, "");
                        }
                    }
                }
            }
            if (!empty($info)) {
                $result =& $ds->ds->Execute("INSERT INTO baseadd\n                        (info, baseindex)\n                        VALUES\n                        (" . $ds->ds->qstr($info) . ", {$id})");
            }
            $ds->DbfTransactionEnd();
            insert($w, textbr());
        } else {
            myError($w, $p, sprintf(my_("Subnet %s could not be created"), inet_ntoa($base)));
        }
    }
}
// end of for loop for multiple subnet creation
// add link if script was called from findfree
// only if all subnets created without error or warning
if (!$warn and $findfree) {
    // $findfree contains HTTP_REFERER which is a full URI already - OK
    header("Location: " . base64_decode($findfree));
    exit;
}
if (!$warn and $num == 1) {
    header("Location: " . location_uri("displaybase.php?cust={$cust}&ipaddr={$ipaddr}"));
    exit;
}
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:createsubnet.php


示例16: insert

        insert($t, $c = cell());
        insert($c, block("<small>"));
        insert($c, block($result->UserTimeStamp($row["swipmod"], "M d Y H:i:s")));
        insert($c, block("</small>"));
    }
    $export->addCell($row["swipmod"]);
    $export->saveRow();
    if ($totcnt % MAXTABLESIZE == MAXTABLESIZE - 1) {
        break;
    }
    $cnt++;
    $totcnt++;
}
insert($w, block("<p>"));
if (!$cnt) {
    myError($w, $p, my_("Search found no matching entries"));
}
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&cust={$cust}&areaindex={$areaindex}" . "&rangeindex={$rangeindex}&ipaddr={$ipaddr}&expr={$expr}&size={$size}" . "&descrip=" . urlencode($descrip));
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
$result->Close();
// create the export view form
$expression = $export->translateExpr($expr);
$export->setInfo(array(array("customer_ID", "customer_description", "area_ID", "range_ID", "search_criterion", "search_expression"), array($cust, $ds->getCustomerDescrip($cust), $areaindex, $rangeindex, $expression, $descrip)));
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:displaybase.php


示例17: newhtml

newhtml($p);
$w = myheading($p, $title, true);
// explicitly cast variables as security measure against SQL injection
list($cust, $rangeindex) = myRegister("I:cust I:rangeindex");
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
if ($_GET) {
    // save the last customer used
    // must set path else Netscape gets confused!
    setcookie("ipplanCustomer", "{$cust}", time() + 10000000, "/");
    // check if user belongs to customer admin group
    $result = $ds->GetCustomerGrp($cust);
    // can only be one row - does not matter if nothing is
    // found as array search will return false
    $row = $result->FetchRow();
    if (!in_array($row["admingrp"], $grps)) {
        myError($w, $p, my_("You may not delete an area for this customer as you are not a member of the customers admin group"));
    }
    if ($rangeindex > 0) {
        $result = $ds->GetRange($cust, $rangeindex);
        $row = $result->FetchRow();
        $rangeip = inet_ntoa($row["rangeaddr"]);
        $rangesize = $row["rangesize"];
        $ds->DbfTransactionStart();
        $result =& $ds->ds->Execute("DELETE FROM netrange\n                              WHERE rangeindex={$rangeindex}") and $ds->AuditLog(array("event" => 162, "action" => "delete range", "baseaddr" => $rangeip, "user" => getAuthUsername(), "size" => $rangesize, "cust" => $cust));
        if ($result) {
            $ds->DbfTransactionEnd();
            Header("Location: " . location_uri("modifyarearange.php?cust={$cust}"));
            exit;
            //insert($w,text(my_("Range deleted")));
        } else {
            insert($w, text(my_("Range could not be deleted")));
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:deleterange.php


示例18: isset

// set language
isset($_COOKIE["ipplanLanguage"]) && myLanguage($_COOKIE['ipplanLanguage']);
//setdefault("window",array("bgcolor"=>"white"));
//setdefault("table",array("cellpadding"=>"0"));
//setdefault("text",array("size"=>"2"));
$title = my_("IPplan Maintenance");
newhtml($p);
$w = myheading($p, $title);
// explicitly cast variables as security measure against SQL injection
list($action, $cust, $block, $requestindex, $requestdesc) = myRegister("S:action I:cust I:block I:requestindex S:requestdesc");
$ds = new IPplanDbf() or myError($w, $p, my_("Could not connect to database"));
if ($action == "deletecustomer") {
    if (DBF_TYPE == "mysql" or DBF_TYPE == "maxsql") {
        $version = $ds->ds->GetOne("SELECT version() AS version");
        if ($version < "4.0.0") {
            myError($w, $p, my_("You need MySQL v4.0.0 or higher for this function!"));
        }
    }
    $ds->DbfTransactionStart();
    $result =& $ds->ds->Execute("DELETE FROM customer\n            WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM custinfo\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM ipaddr \n                WHERE baseindex IN (SELECT baseindex FROM base WHERE customer={$cust})") and $result =& $ds->ds->Execute("DELETE FROM ipaddradd\n                WHERE baseindex IN (SELECT baseindex FROM base WHERE customer={$cust})") and $result =& $ds->ds->Execute("DELETE FROM base\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM custadd\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM revdns\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM area\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM netrange\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM fwdzone\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM fwdzoneadd\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM fwdzonerec\n                WHERE customer={$cust}") and $result =& $ds->ds->Execute("DELETE FROM zones\n                WHERE customer={$cust}") and $ds->AuditLog(array("event" => 182, "action" => "delete customer", "user" => getAuthUsername(), "cust" => $cust));
    if ($result) {
        $ds->DbfTransactionEnd();
        insert($w, text(my_("Customer deleted")));
    } else {
        insert($w, text(my_("Customer could not be deleted")));
    }
}
if ($action == "deleterequest") {
    $ds->DbfTransactionStart();
    $result =& $ds->ds->Execute("DELETE FROM requestip");
    $ds->AuditLog(my_("Requested IP addresses cleared"));
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:maintenance.php


示例19: insert

    insert($f, anchor("javascript:checkAll(1)", my_("Check all")));
    insert($f, block(" | "));
    insert($f, anchor("javascript:checkAll(0)", my_("Clear all")));
    insert($f, block("<p>"));
    insert($f, submit(array("value" => my_("Delete multiple"))));
}
$vars = "";
$printed = 0;
while ($row = $result->FetchRow()) {
    $totcnt++;
    $vars = DisplayBlock($w, $row, $totcnt, "&domain=" . urlencode($domain) . "&cust=" . $cust . "&expr={$expr}&descrip=" . urlencode($descrip), "sortorder");
    if (!empty($vars) and !$printed) {
        insert($ck, anchor($vars, ">>"));
        $printed = 1;
    }
}
if ($domain) {
    insert($w, $f = form(array("method" => "post", "action" => "modifydnsrecordform.php?cust={$cust}&action=add&domain=" . urlencode($domain) . "&zoneid=" . $zoneid)));
    insert($f, submit(array("value" => my_("Add a Host"))));
}
if (!$cnt) {
    myError($w, $p, my_("No Records found.  Please choose a domain and try again."));
} else {
    insert($f, anchor($_SERVER["PHP_SELF"] . "?cust={$cust}&action=renumber&domain=" . urlencode($domain) . "&block={$block}", my_("Renumber SortOrder"), $ipplanParanoid ? array("onclick" => "return confirm('" . my_("Are you sure?") . "')") : FALSE));
}
$result->Close();
// create the export view form
$expression = $export->translateExpr($expr);
$export->setInfo(array(array("customer_ID", "customer_description", "search_criterion", "search_expression"), array($cust, $ds->getCustomerDescrip($cust), $expression, $descrip)));
$export->createExportForm($w, NULL);
printhtml($p);
开发者ID:hetznerZA,项目名称:ipplan,代码行数:31,代码来源:modifydnsrecord.php


示例20: ProcessRow

function ProcessRow($ds, $cust, &$w, &$p, $data, $template, $append)
{
    global $format;
    $num = count($data);
    // blank row
    if (empty($data[0])) {
        insert($w, block("<b>" . my_("Row is blank - ignoring") . "</b>"));
        return;
    }
    // bogus row
    if ($num < 7) {
        // ok to save what has been imported already
        $ds->DbfTransactionEnd();
        myError($w, $p, my_("Row not the correct format."));
    }
    if (testIP(trim($data[0]))) {
        insert($w, block("<b>" . my_("Invalid IP address") . "</b>"));
        return;
    }
    $ip = inet_aton(trim($data[0]));
    $user = substr($data[1], 0, 80);
    $location = substr($data[2], 0, 80);
    $descrip = substr($data[3], 0, 80);
    $hname = substr($data[4], 0, 100);
    $telno = substr($data[5], 0, 15);
    $macaddr = substr($data[6], 0, 12);
    if ($format == "xml") {
        $macaddr = $data[6];
    }
    $info = "";
    if (is_object($template)) {
        // all columns over 6 are considered for adding to template fields
        $cnt = 7;
        $userfld = array();
        foreach ($template->userfld as $key => $value) {
            // set fields in template only if field in import file exists, else make blank
            $userfld[$key] = isset($data[$cnt]) ? $data[$cnt] : "";
            $cnt++;
        }
        $template->Merge($userfld);
        $err = $template->Verify($w);
        if ($err) {
            // ok to save what has been imported already
            $ds->DbfTransactionEnd();
            myError($w, $p, my_("Row failed template verify."));
        }
        if ($template->is_blank() == FALSE) {
            $info = $template->encode();
        }
    }
    // NOTE: Test ip address
    $result = $ds->GetBaseFromIP($ip, $cust);
    if (!($row = $result->FetchRow())) {
        // ok to save what has been imported already
        $ds->DbfTransactionEnd();
        myError($w, $p, sprintf(my_("Subnet could not be found for IP address %s"), $data[0]));
    }
    $baseindex = $row["baseindex"];
    $baseaddr = $row["baseaddr"];
    $subnetsize = $row["subnetsize"];
    if ($append == "on") {
        $ip = (array) $ip;
        if ($user === "NULL") {
            $user = "";
        }
        if ($location === "NULL") {
            $location = "";
        }
        if ($telno === "NULL") {
            $telno = "";
        }
        if ($macaddr === "NULL") {
            $macaddr = "";
        }
        if ($descrip === "NULL") {
            $descrip = "";
        }
        if ($hname === "NULL") {
            $hname = "";
        }
    }
    if ($ds->ModifyIP($ip, $baseindex, $user, $location, $telno, $macaddr, $descrip, $hname, $info) == 0) {
        insert($w, text(my_("IP address details modified")));
    } else {
        insert($w, text(my_("IP address details could not be modified")));
    }
}
开发者ID:hetznerZA,项目名称:ipplan,代码行数:87,代码来源:importip.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP myLanguage函数代码示例发布时间:2022-05-15
下一篇:
PHP mwexec_bg函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap