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


PHP myError函数代码示例

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


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


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