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


PHP auth_ok函数代码示例

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


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

示例1: auth_ok_callback

 function auth_ok_callback($config = array())
 {
     $ok = FALSE;
     if (!$config) {
         $config = config_get();
     }
     if (!config_error($config)) {
         $ok = auth_ok($config);
     }
     return $ok;
 }
开发者ID:Cinemacloud,项目名称:angular-moviemasher,代码行数:11,代码来源:authutils.php

示例2: auth_require

function auth_require($target = false)
{
    global $config;
    if (auth_ok()) {
        return;
    }
    if ($target) {
        redirect(uri($target));
    }
    exit;
}
开发者ID:senko,项目名称:rfx,代码行数:11,代码来源:user.php

示例3: alert

    if (!value) return;
    
    if (!value.match(pattern)) {
      alert("The font name specified for "+name+" is not a TrueType font");
      ok = false;
      return false;
    }
  });
    
  return ok;
}
</script>

<?php 
if (auth_ok()) {
    $max_size = min(to_bytes(ini_get('post_max_size')), to_bytes(ini_get('upload_max_filesize')));
    ?>

<form name="upload-font" method="post" action="controller.php?cmd=install-font" target="upload-font" enctype="multipart/form-data" onsubmit="return checkFileName(this)">
  <input type="hidden" name="MAX_FILE_SIZE" value="<?php 
    echo $max_size;
    ?>
" />
  
  <table class="setup">
    <tr>
      <td class="title">Name</td>
      <td><input type="text" name="family" /></td>
      <td rowspan="6"><iframe name="upload-font" id="upload-font" style="border: 0; width: 500px;"></iframe></td>
    </tr>
开发者ID:practo,项目名称:dompdf,代码行数:30,代码来源:fonts.php

示例4: session_start

<?php

session_start();
$cmd = isset($_GET["cmd"]) ? $_GET["cmd"] : null;
include "../dompdf_config.inc.php";
include "functions.inc.php";
switch ($cmd) {
    case "clear-font-cache":
        $files = glob(DOMPDF_FONT_DIR . "*.{UFM,AFM,ufm,afm}.php", GLOB_BRACE);
        foreach ($files as $file) {
            unlink($file);
        }
        break;
    case "install-font":
        if (!auth_ok()) {
            break;
        }
        $family = $_POST["family"];
        $data = $_FILES["file"];
        foreach ($data["error"] as $name => $error) {
            if ($error) {
                switch ($error) {
                    case UPLOAD_ERR_INI_SIZE:
                    case UPLOAD_ERR_FORM_SIZE:
                        echo "The uploaded file exceeds the upload_max_filesize directive in php.ini.";
                        break;
                    case UPLOAD_ERR_PARTIAL:
                        echo "The uploaded file was only partially uploaded.";
                        break;
                    case UPLOAD_ERR_NO_FILE:
                        break;
开发者ID:practo,项目名称:dompdf,代码行数:31,代码来源:controller.php

示例5: array

$err = '';
$config = array();
if (!@(include_once dirname(__FILE__) . '/include/loadutils.php')) {
    $err = 'Problem loading utility script';
}
if (!$err && !load_utils('auth', 'service')) {
    $err = 'Problem loading utility scripts';
}
if (!$err) {
    // pull in configuration so we can log other errors
    $config = config_get();
    $err = config_error($config);
    $log_responses = $config['log_response'];
}
// autheticate the user (will exit if not possible)
if (!$err && !auth_ok()) {
    auth_challenge($config);
}
if (!$err) {
    // pull in other configuration and check for required input
    if (!($php_input = file_get_contents('php://input'))) {
        $err = 'JSON payload required';
    } else {
        if (!($request = @json_decode($php_input, TRUE))) {
            $err = 'Could not parse JSON payload';
        }
    }
}
if (!$err) {
    if ($config['log_request']) {
        log_file(print_r($request, 1), $config);
开发者ID:Cinemacloud,项目名称:angular-moviemasher,代码行数:31,代码来源:import_init.php

示例6: DOMPDF

    }
    $dompdf = new DOMPDF();
    $dompdf->load_html($_POST["html"]);
    $dompdf->set_paper($_POST["paper"], $_POST["orientation"]);
    $dompdf->render();
    $dompdf->stream("dompdf_out.pdf", array("Attachment" => false));
    exit(0);
}
include "head.inc";
?>

<a name="demo"> </a>
<h2>Demo</h2>

<?php 
if (auth_ok() && $is_local) {
    ?>

<p>Enter your html snippet in the text box below to see it rendered as a
PDF: (Note by default, remote stylesheets, images &amp; inline PHP are disabled.)</p>

<form action="<?php 
    echo $_SERVER["PHP_SELF"];
    ?>
" method="post">
<p>Paper size and orientation:
<select name="paper">
<?php 
    foreach (array_keys(CPDF_Adapter::$PAPER_SIZES) as $size) {
        echo "<option " . ($size == "letter" ? "selected " : "") . "value=\"{$size}\">{$size}</option>\n";
    }
开发者ID:alvarobfdev,项目名称:applog,代码行数:31,代码来源:demo.php

示例7: isset

$cmd = isset($_GET["cmd"]) ? $_GET["cmd"] : null;

include "../dompdf_config.inc.php";
include "functions.inc.php";

switch ($cmd) {
  case "clear-font-cache":
    $files = glob(DOMPDF_FONT_CACHE."*.{UFM,AFM,ufm,afm}.php", GLOB_BRACE);
    foreach($files as $file) {
      unlink($file);
    }
  break;

  case "install-font":
    if (!auth_ok()) break;

    $family = $_POST["family"];
    $data = $_FILES["file"];

    foreach($data["error"] as $name => $error) {
      if ($error) {
        switch($error) {
          case UPLOAD_ERR_INI_SIZE:
          case UPLOAD_ERR_FORM_SIZE:
            echo "The uploaded file exceeds the upload_max_filesize directive in php.ini."; break;
          case UPLOAD_ERR_PARTIAL:
            echo "The uploaded file was only partially uploaded."; break;
          case UPLOAD_ERR_NO_FILE:
            break;
          case UPLOAD_ERR_NO_TMP_DIR:
开发者ID:hendrosteven,项目名称:f3-template,代码行数:30,代码来源:controller.php

示例8: foreach

<h2>Hello world!</h2>
<p>
    If you're seeing this page, that means that RFX is properly installed. Hooray!
</p>

<p>
    You provided the following arguments:
    <ul>
        <? foreach (uri_args() as $k => $v): ?>
            <li><b><?php 
echo $k;
?>
</b> = <?php 
echo htmlspecialchars($v);
?>
</li>    
        <? endforeach ?>
    </ul>
</p>

<p><? if (auth_ok()) { ?>
    You are authenticated
<? } else { ?>
    You are not authenticated
<? } ?></p>
开发者ID:senko,项目名称:rfx,代码行数:25,代码来源:default.php

示例9: array

<?php

require_once "functions.inc.php";
$allowed_hosts = array("::1", "127.0.0.1");
if (!auth_ok() || !in_array($_SERVER['REMOTE_ADDR'], $allowed_hosts)) {
    die("Access denied to host at " . $_SERVER['REMOTE_ADDR']);
}
$files = glob("test/*.{html,htm,php}", GLOB_BRACE);
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <title>dompdf debugger</title>
  <meta name="robots" content="noindex">
  <script type="text/javascript" src="jquery-1.4.2.js"></script>
  
  <script type="text/javascript">
    function updateAddress(){
      var addressbar = $('#addressbar'),
          preview = $('#preview'),
          preview_html = $('#preview_html'),
          address = encodeURI(addressbar.val()),
          addressHTML = address,
          addressPDF = address,
          basePath = "";

      if ( !/[a-z]+:\/\//.test(address) ) {
        addressHTML = "test/"+address+"?"+(new Date).getTime();
        basePath = "www/test/";
      }
开发者ID:alvarobfdev,项目名称:applog,代码行数:31,代码来源:debugger.php


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