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


PHP dbg_error_log函数代码示例

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


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

示例1: SQUID_PAM_check

/**
* Check the username / password against the PAM system
*/
function SQUID_PAM_check($username, $password)
{
    global $c;
    $script = $c->authenticate_hook['config']['script'];
    if (empty($script)) {
        $script = $c->authenticate_hook['config']['path'];
    }
    $cmd = sprintf('echo %s %s | %s -n common-auth', escapeshellarg($username), escapeshellarg($password), $script);
    $auth_result = exec($cmd);
    if ($auth_result == "OK") {
        dbg_error_log('pwauth', 'User %s successfully authenticated', $username);
        $principal = new Principal('username', $username);
        if (!$principal->Exists()) {
            dbg_error_log('pwauth', 'User %s does not exist in local db, creating', $username);
            $pwent = posix_getpwnam($username);
            $gecos = explode(',', $pwent['gecos']);
            $fullname = $gecos[0];
            $principal->Create(array('username' => $username, 'user_active' => 't', 'email' => sprintf('%s@%s', $username, $email_base), 'fullname' => $fullname));
            if (!$principal->Exists()) {
                dbg_error_log("PAM", "Unable to create local principal for '%s'", $username);
                return false;
            }
            CreateHomeCalendar($username);
        }
        return $principal;
    } else {
        dbg_error_log("PAM", "User %s is not a valid username (or password was wrong)", $username);
        return false;
    }
}
开发者ID:derekyu1437,项目名称:davical,代码行数:33,代码来源:drivers_squid_pam.php

示例2: SQUID_PAM_check

/**
* Check the username / password against the PAM system
*/
function SQUID_PAM_check($username, $password)
{
    global $c;
    /**
     * @todo Think of the children!  This is a horribly insecure use of unvalidated user input!  Probably it should be done with a popen or something, and it seems remarkably dodgy to expect that naively quoted strings will work in any way reliably.
     * Meanwhile, I've quickly hacked something basic in place to improve the situation.  No quotes/backslashes in passwords for YOU!
     */
    $username = str_replace("'", "", str_replace('"', "", str_replace('\\', "", $username)));
    $password = str_replace("'", "", str_replace('"', "", str_replace('\\', "", $password)));
    $cmd = "echo '" . $username . "' '" . $password . "' | " . $c->authenticate_hook['config']['script'] . " -n common-auth";
    $auth_result = exec($cmd);
    if ($auth_result == "OK") {
        if ($usr = getUserByName($username)) {
            return $usr;
        } else {
            dbg_error_log("PAM", "user %s doesn't exist in local DB, we need to create it", $username);
            $fullname = exec('getent passwd "' . $username . '"');
            $fullname = preg_replace('{^[^:]+:[^:]+:\\d+:\\d+:([^:,]+)(,?[^:]*):.*$}', '$1', $fullname);
            $usr = (object) array('user_no' => 0, 'username' => $username, 'active' => 't', 'email' => $username . "@" . $c->authenticate_hook['config']['email_base'], 'updated' => date(), 'fullname' => $fullname);
            UpdateUserFromExternal($usr);
            return $usr;
        }
    } else {
        dbg_error_log("PAM", "User %s is not a valid username (or password was wrong)", $username);
        return false;
    }
}
开发者ID:rossryan,项目名称:Calico,代码行数:30,代码来源:drivers_squid_pam.php

示例3: CheckPassword

 /**
  * CheckPassword does all of the password checking and
  * returns a user record object, or false if it all ends in tears.
  */
 function CheckPassword($username, $password)
 {
     $qry = new PgQuery("SELECT * FROM usr WHERE lower(username) = ? ", $username);
     if ($qry->Exec('BasicAuthSession', __LINE, __FILE__) && $qry->rows == 1) {
         $usr = $qry->Fetch();
         dbg_error_log("BasicAuthSession", "Name:%s, Pass:%s, File:%s", $username, $password, $usr->password);
         if (session_validate_password($password, $usr->password)) {
             return $usr;
         }
     }
     return false;
 }
开发者ID:Br3nda,项目名称:wrms,代码行数:16,代码来源:BasicAuthSession.php

示例4: delete_collection

function delete_collection($id)
{
    $params = array(':collection_id' => $id);
    $qry = new AwlQuery('SELECT child.collection_id AS child_id FROM collection child JOIN collection parent ON (parent.dav_name = child.parent_container) WHERE parent.collection_id = :collection_id', $params);
    if ($qry->Exec('DELETE', __LINE__, __FILE__) && $qry->rows() > 0) {
        while ($row = $qry->Fetch()) {
            delete_collection($row->child_id);
        }
    }
    if ($qry->QDo("SELECT write_sync_change(collection_id, 404, caldav_data.dav_name) FROM caldav_data WHERE collection_id = :collection_id", $params) && $qry->QDo("DELETE FROM property WHERE dav_name LIKE (SELECT dav_name FROM collection WHERE collection_id = :collection_id) || '%'", $params) && $qry->QDo("DELETE FROM locks WHERE dav_name LIKE (SELECT dav_name FROM collection WHERE collection_id = :collection_id) || '%'", $params) && $qry->QDo("DELETE FROM caldav_data WHERE collection_id = :collection_id", $params) && $qry->QDo("DELETE FROM collection WHERE collection_id = :collection_id", $params)) {
        @dbg_error_log("DELETE", "DELETE (collection): User: %d, ETag: %s, Path: %s", $session->user_no, $request->etag_if_match, $request->path);
        return true;
    }
    return false;
}
开发者ID:derekyu1437,项目名称:davical,代码行数:15,代码来源:caldav-DELETE.php

示例5: IMAP_PAM_check

/**
* Check the username / password against the PAM system
*/
function IMAP_PAM_check($username, $password)
{
    global $c;
    $imap_username = $username;
    if (function_exists('mb_convert_encoding')) {
        $imap_username = mb_convert_encoding($imap_username, "UTF7-IMAP", mb_detect_encoding($imap_username));
    } else {
        $imap_username = imap_utf7_encode($imap_username);
    }
    //$imap_url = '{localhost:143/imap/notls}';
    //$imap_url = '{localhost:993/imap/ssl/novalidate-cert}';
    $imap_url = $c->authenticate_hook['config']['imap_url'];
    $auth_result = "ERR";
    $imap_stream = @imap_open($imap_url, $imap_username, $password, OP_HALFOPEN);
    //print_r(imap_errors());
    if ($imap_stream) {
        // disconnect
        imap_close($imap_stream);
        // login ok
        $auth_result = "OK";
    }
    if ($auth_result == "OK") {
        $principal = new Principal('username', $username);
        if (!$principal->Exists()) {
            dbg_error_log("PAM", "Principal '%s' doesn't exist in local DB, we need to create it", $username);
            $cmd = "getent passwd '{$username}'";
            $getent_res = exec($cmd);
            $getent_arr = explode(":", $getent_res);
            $fullname = $getent_arr[4];
            if (empty($fullname)) {
                $fullname = $username;
            }
            $principal->Create(array('username' => $username, 'user_active' => true, 'email' => $username . "@" . $c->authenticate_hook['config']['email_base'], 'modified' => date('c'), 'fullname' => $fullname));
            if (!$principal->Exists()) {
                dbg_error_log("PAM", "Unable to create local principal for '%s'", $username);
                return false;
            }
            CreateHomeCalendar($username);
        }
        return $principal;
    } else {
        dbg_error_log("PAM", "User %s is not a valid username (or password was wrong)", $username);
        return false;
    }
}
开发者ID:derekyu1437,项目名称:davical,代码行数:48,代码来源:drivers_imap_pam.php

示例6: logRequestHeaders

function logRequestHeaders()
{
    global $c;
    /** Log the request headers */
    $lines = apache_request_headers();
    dbg_error_log("LOG ", "***************** Request Header ****************");
    dbg_error_log("LOG ", "%s %s", $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);
    foreach ($lines as $k => $v) {
        if ($k != 'Authorization' || isset($c->dbg['password']) && $c->dbg['password']) {
            dbg_error_log("LOG headers", "-->%s: %s", $k, $v);
        } else {
            dbg_error_log("LOG headers", "-->%s: %s", $k, 'Delicious tasty password eaten by debugging monster!');
        }
    }
    dbg_error_log("LOG ", "******************** Request ********************");
    // Log the request in all it's gory detail.
    $lines = preg_split('#[\\r\\n]+#', $c->raw_post);
    foreach ($lines as $v) {
        dbg_error_log("LOG request", "-->%s", $v);
    }
    unset($lines);
}
开发者ID:derekyu1437,项目名称:davical,代码行数:22,代码来源:caldav.php

示例7: __construct

 public function __construct($in_dtz = null)
 {
     $this->tz_defined = false;
     if (!isset($in_dtz)) {
         return;
     }
     $olson = olson_from_tzstring($in_dtz);
     if (isset($olson)) {
         try {
             parent::__construct($olson);
             $this->tz_defined = $olson;
         } catch (Exception $e) {
             dbg_error_log('ERROR', 'Could not handle timezone "%s" (%s) - will use floating time', $in_dtz, $olson);
             parent::__construct('UTC');
             $this->tz_defined = false;
         }
     } else {
         dbg_error_log('ERROR', 'Could not recognize timezone "%s" - will use floating time', $in_dtz);
         parent::__construct('UTC');
         $this->tz_defined = false;
     }
 }
开发者ID:rossryan,项目名称:Calico,代码行数:22,代码来源:RRule-v2.php

示例8: __construct

 /**
  * Constructor
  * @param string $ticket_id
  */
 function __construct($ticket_id)
 {
     global $c;
     $this->dav_name = null;
     $this->target_collection_id = null;
     $this->target_resource_id = null;
     $this->expiry = null;
     $this->expired = true;
     $this->dav_owner_id = null;
     $this->ticket_id = $ticket_id;
     $this->privileges = 0;
     $this->grantor_collection_privileges = 0;
     $qry = new AwlQuery('SELECT access_ticket.*, collection.dav_name, (access_ticket.expires < current_timestamp) AS expired,
             path_privs(access_ticket.dav_owner_id,collection.dav_name,:scan_depth) AS grantor_collection_privileges
        FROM access_ticket JOIN collection ON (target_collection_id = collection_id)
       WHERE ticket_id = :ticket_id::text', array(':ticket_id' => $ticket_id, ':scan_depth' => $c->permission_scan_depth));
     if ($qry->Exec('DAVTicket', __LINE__, __FILE__) && $qry->rows() == 1 && ($t = $qry->Fetch())) {
         if (!$t->expired) {
             foreach ($t as $k => $v) {
                 $this->{$k} = $v;
             }
             $this->expired = false;
             $this->privileges = bindec($this->privileges);
             $this->grantor_collection_privileges = bindec($this->grantor_collection_privileges);
             dbg_error_log('DAVTicket', 'Found a current ticket for "%s"', implode(', ', bits_to_privilege($this->privileges())));
         } else {
             dbg_error_log('DAVTicket', 'Found an expired ticket: %s - %s', $ticket_id, $t->expires);
         }
     }
     if (isset($this->target_resource_id)) {
         $qry = new AwlQuery('SELECT dav_name FROM caldav_data WHERE dav_id = :dav_id', array(':dav_id' => $this->target_resource_id));
         if ($qry->Exec('DAVTicket', __LINE__, __FILE__) && $qry->rows() == 1 && ($r = $qry->Fetch())) {
             $this->dav_name = $r->dav_name;
         }
     }
 }
开发者ID:derekyu1437,项目名称:davical,代码行数:40,代码来源:DAVTicket.php

示例9: get_collection_contents

/**
* Get XML response for items in the collection
* If '/' is requested, a list of visible users is given, otherwise
* a list of calendars for the user which are parented by this path.
*/
function get_collection_contents($depth, $collection, $parent_path = null)
{
    global $c, $session, $request, $reply, $property_list;
    $bound_from = $collection->bound_from();
    $bound_to = $collection->dav_name();
    if (!isset($parent_path)) {
        $parent_path = $collection->dav_name();
    }
    dbg_error_log('PROPFIND', 'Getting collection contents: Depth %d, Path: %s, Bound from: %s, Bound to: %s', $depth, $collection->dav_name(), $bound_from, $bound_to);
    $date_format = AwlDatabase::HttpDateFormat;
    $responses = array();
    if (!$collection->IsCalendar() && !$collection->IsAddressbook()) {
        /**
         * Calendar/Addressbook collections may not contain collections, so we are only looking in the other ones
         */
        $params = array(':session_principal' => $session->principal_id, ':scan_depth' => $c->permission_scan_depth);
        if ($bound_from == '/') {
            $sql = "SELECT usr.*, '/' || username || '/' AS dav_name, md5(username || updated::text) AS dav_etag, ";
            $sql .= "to_char(joined at time zone 'GMT',{$date_format}) AS created, ";
            $sql .= "to_char(updated at time zone 'GMT',{$date_format}) AS modified, ";
            $sql .= 'FALSE AS is_calendar, TRUE AS is_principal, FALSE AS is_addressbook, \'principal\' AS type, ';
            $sql .= 'principal_id AS collection_id, ';
            $sql .= 'principal.* ';
            $sql .= 'FROM usr JOIN principal USING (user_no) ';
            $sql .= "WHERE (pprivs(:session_principal::int8,principal.principal_id,:scan_depth::int) & 1::BIT(24))::INT4::BOOLEAN ";
            $sql .= 'ORDER BY usr.user_no';
        } else {
            $qry = new AwlQuery('SELECT * FROM dav_binding WHERE dav_binding.parent_container = :this_dav_name ORDER BY bind_id', array(':this_dav_name' => $bound_from));
            if ($qry->Exec('PROPFIND', __LINE__, __FILE__) && $qry->rows() > 0) {
                while ($binding = $qry->Fetch()) {
                    $resource = new DAVResource($binding->dav_name);
                    if ($resource->IsExternal()) {
                        require_once "external-fetch.php";
                        update_external($resource);
                    }
                    if ($resource->HavePrivilegeTo('DAV::read', false)) {
                        $resource->set_bind_location(str_replace($bound_from, $bound_to, $binding->dav_name));
                        $responses[] = $resource->RenderAsXML($property_list, $reply);
                        if ($depth > 0) {
                            $responses = array_merge($responses, get_collection_contents($depth - 1, $resource, $binding->dav_name));
                        }
                    }
                }
            }
            $sql = 'SELECT principal.*, collection.*, \'collection\' AS type ';
            $sql .= 'FROM collection LEFT JOIN principal USING (user_no) ';
            $sql .= 'WHERE parent_container = :this_dav_name ';
            $sql .= ' ORDER BY collection_id';
            $params[':this_dav_name'] = $bound_from;
            unset($params[':session_principal']);
            unset($params[':scan_depth']);
        }
        $qry = new AwlQuery($sql, $params);
        if ($qry->Exec('PROPFIND', __LINE__, __FILE__) && $qry->rows() > 0) {
            while ($subcollection = $qry->Fetch()) {
                $resource = new DAVResource($subcollection);
                if (!$resource->HavePrivilegeTo('DAV::read')) {
                    continue;
                }
                $resource->set_bind_location(str_replace($bound_from, $bound_to, $subcollection->dav_name));
                $responses[] = $resource->RenderAsXML($property_list, $reply);
                if ($depth > 0) {
                    $responses = array_merge($responses, get_collection_contents($depth - 1, $resource, str_replace($resource->parent_path(), $parent_path, $resource->dav_name())));
                }
            }
        }
        if ((!isset($c->disable_caldav_proxy) || $c->disable_caldav_proxy == false) && $collection->IsPrincipal()) {
            // Caldav Proxy: 5.1 par. 2: Add child resources calendar-proxy-(read|write)
            dbg_error_log('PROPFIND', 'Adding calendar-proxy-read and write. Path: %s', $bound_from);
            $response = add_proxy_response('read', $bound_from);
            if (isset($response)) {
                $responses[] = $response;
            }
            $response = add_proxy_response('write', $bound_from);
            if (isset($response)) {
                $responses[] = $response;
            }
        }
    }
    /**
     * freebusy permission is not allowed to see the items in a collection.  Must have at least read permission.
     */
    if ($collection->HavePrivilegeTo('DAV::read', false)) {
        dbg_error_log('PROPFIND', 'Getting collection items: Depth %d, Path: %s', $depth, $bound_from);
        $privacy_clause = ' ';
        $todo_clause = ' ';
        $time_limit_clause = ' ';
        if ($collection->IsCalendar()) {
            if (!$collection->HavePrivilegeTo('all', false)) {
                $privacy_clause = " AND (calendar_item.class != 'PRIVATE' OR calendar_item.class IS NULL) ";
            }
            if (isset($c->hide_TODO) && ($c->hide_TODO === true || is_string($c->hide_TODO) && preg_match($c->hide_TODO, $_SERVER['HTTP_USER_AGENT'])) && !$collection->HavePrivilegeTo('all')) {
                $todo_clause = " AND caldav_data.caldav_type NOT IN ('VTODO') ";
            }
            if (isset($c->hide_older_than) && intval($c->hide_older_than > 0)) {
//.........这里部分代码省略.........
开发者ID:derekyu1437,项目名称:davical,代码行数:101,代码来源:caldav-PROPFIND.php

示例10: dbg_error_log

<?php

/**
* CalDAV Server - handle PUT method
*
* @package   davical
* @subpackage   caldav
* @author    Andrew McMillan <andrew@mcmillan.net.nz>
* @copyright Catalyst .Net Ltd, Morphoss Ltd
* @license   http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
*/
dbg_error_log("PUT", "method handler");
require_once 'DAVResource.php';
$dav_resource = new DAVResource($request->path);
if (!$dav_resource->HavePrivilegeTo('DAV::write-content')) {
    $request->DoResponse(403);
}
if (!$dav_resource->Exists() && !$dav_resource->HavePrivilegeTo('DAV::bind')) {
    $request->DoResponse(403);
}
if (!ini_get('open_basedir') && (isset($c->dbg['ALL']) || isset($c->dbg['put']) && $c->dbg['put'])) {
    $fh = fopen('/tmp/PUT.txt', 'w');
    if ($fh) {
        fwrite($fh, $request->raw_post);
        fclose($fh);
    }
}
include_once 'caldav-PUT-functions.php';
controlRequestContainer($dav_resource->GetProperty('username'), $dav_resource->GetProperty('user_no'), $dav_resource->bound_from(), true);
$lock_opener = $request->FailIfLocked();
if ($dav_resource->IsCollection()) {
开发者ID:rossryan,项目名称:Calico,代码行数:31,代码来源:caldav-PUT.php

示例11: iCalFooter

 /**
  * Returns the footer we always use at the finish of our iCalendar resources
  *
  * @deprecated This function is deprecated and will be removed eventually.
  * @todo Remove this function.
  */
 function iCalFooter()
 {
     dbg_error_log("LOG", " iCalendar: Call to deprecated method '%s'", 'iCalFooter');
     return "END:VCALENDAR\r\n";
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:11,代码来源:iCalendar.php

示例12: ticket_row_editor

function ticket_row_editor()
{
    global $c, $id, $editor, $can_write_principal, $privilege_names;
    $ticketrow = new Editor("Tickets", "access_ticket");
    $ticketrow->SetSubmitName('ticketrow');
    dbg_error_log("ERROR", "Creating ticketrow editor: %s - %s", $can_write_principal, $ticketrow->IsSubmit());
    if ($can_write_principal && $ticketrow->IsSubmit()) {
        $username = $editor->Value('username');
        $ugly_path = $_POST['target'];
        if ($ugly_path == '/' . $username || $ugly_path == '/' . $username . '/') {
            $target_collection = $id;
        } else {
            $username_len = strlen($username) + 2;
            $sql = "SELECT collection_id FROM collection WHERE dav_name = :exact_name";
            $sql .= " AND substring(dav_name FROM 1 FOR {$username_len}) = '/{$username}/'";
            $params = array(':exact_name' => $ugly_path);
            if (!preg_match('#/$#', $ugly_path)) {
                $sql .= " OR dav_name = :truncated_name OR dav_name = :trailing_slash_name";
                $params[':truncated_name'] = preg_replace('#[^/]*$#', '', $ugly_path);
                $params[':trailing_slash_name'] = $ugly_path . "/";
            }
            $sql .= " ORDER BY LENGTH(dav_name) DESC LIMIT 1";
            $qry = new AwlQuery($sql, $params);
            if ($qry->Exec() && $qry->rows() > 0) {
                $row = $qry->Fetch();
                $target_collection = $row->collection_id;
            } else {
                $c->messages[] = translate('Can only add tickets for existing collection paths which you own');
                return $ticketrow;
            }
        }
        $_POST['dav_owner_id'] = $id;
        $_POST['target_collection_id'] = $target_collection;
        $ticket_id = clean_by_regex($_POST['ticket_id'], '/[A-Za-z0-9]+/');
        $ticketrow->SetWhere('dav_owner_id=' . $id . ' AND ticket_id=' . AwlQuery::quote($ticket_id));
        if (isset($_POST['ticket_privileges'])) {
            $privilege_bitpos = array_flip($privilege_names);
            $priv_names = array_keys($_POST['ticket_privileges']);
            $privs_dec = privilege_to_bits($priv_names);
            $_POST['privileges'] = sprintf('%024s', decbin($privs_dec));
            $ticketrow->Assign('privileges', $privs_dec);
        }
        $c->messages[] = translate('Creating new ticket granting privileges to this Principal');
        $ticketrow->Write();
    }
    return $ticketrow;
}
开发者ID:rossryan,项目名称:Calico,代码行数:47,代码来源:principal-edit.php

示例13: check_string

function check_string($ics)
{
    $ics_file = explode("\n", $ics);
    foreach ($ics_file as $line => $str) {
        if (false === utf8ToUnicode($str)) {
            $error[] = $line;
        }
    }
    if (isset($error) && is_array($error)) {
        foreach ($error as $line) {
            dbg_error_log("LOG check_string", "error on lines %  invalid character in string %s", $line + 1, $ics_file[$line]);
            return false;
        }
    } else {
        dbg_error_log("LOG check_string", "the string is UTF8 compliant");
        return true;
    }
}
开发者ID:rossryan,项目名称:Calico,代码行数:18,代码来源:check_UTF8.php

示例14: UpdateUserFromExternal

/**
* Update the local cache of the remote user details
* @param object $usr The user details we read from the remote.
*/
function UpdateUserFromExternal(&$usr)
{
    global $c;
    /**
     * When we're doing the create we will usually need to generate a user number
     */
    if (!isset($usr->user_no) || intval($usr->user_no) == 0) {
        $qry = new AwlQuery("SELECT nextval('usr_user_no_seq');");
        $qry->Exec('Login', __LINE__, __FILE__);
        $sequence_value = $qry->Fetch(true);
        // Fetch as an array
        $usr->user_no = $sequence_value[0];
    }
    $qry = new AwlQuery('SELECT * FROM usr WHERE user_no = :user_no', array(':user_no' => $usr->user_no));
    if ($qry->Exec('Login', __LINE__, __FILE__) && $qry->rows() == 1) {
        $type = "UPDATE";
        if ($old = $qry->Fetch()) {
            $changes = false;
            foreach ($usr as $k => $v) {
                if ($old->{$k} != $v) {
                    $changes = true;
                    dbg_error_log("Login", "User '%s' field '%s' changed from '%s' to '%s'", $usr->username, $k, $old->{$k}, $v);
                    break;
                }
            }
            if (!$changes) {
                dbg_error_log("Login", "No changes to user record for '%s' - leaving as-is.", $usr->username);
                if (isset($usr->active) && $usr->active == 'f') {
                    return false;
                }
                return;
                // Normal case, if there are no changes
            } else {
                dbg_error_log("Login", "Changes to user record for '%s' - updating.", $usr->username);
            }
        }
    } else {
        $type = "INSERT";
    }
    $params = array();
    if ($type != 'INSERT') {
        $params[':user_no'] = $usr->user_no;
    }
    $qry = new AwlQuery(sql_from_object($usr, $type, 'usr', 'WHERE user_no= :user_no'), $params);
    $qry->Exec('Login', __LINE__, __FILE__);
    /**
     * We disallow login by inactive users _after_ we have updated the local copy
     */
    if (isset($usr->active) && ($usr->active === 'f' || $usr->active === false)) {
        return false;
    }
    if ($type == 'INSERT') {
        $qry = new AwlQuery('INSERT INTO principal( type_id, user_no, displayname, default_privileges) SELECT 1, user_no, fullname, :privs::INT::BIT(24) FROM usr WHERE username=:username', array(':privs' => privilege_to_bits($c->default_privileges), ':username' => $usr->username));
        $qry->Exec('Login', __LINE__, __FILE__);
        CreateHomeCalendar($usr->username);
    } else {
        if ($usr->fullname != $old->{'fullname'}) {
            // Also update the displayname if the fullname has been updated.
            $qry->QDo('UPDATE principal SET displayname=:new_display WHERE user_no=:user_no', array(':new_display' => $usr->fullname, ':user_no' => $usr->user_no));
        }
    }
}
开发者ID:rossryan,项目名称:Calico,代码行数:66,代码来源:auth-functions.php

示例15: dbg_error_log

*
* Why are we using a defunct RFC?  Well, we want to support some kind of system
* for providing a URI to people to give out for granting privileged access
* without requiring logins.  Using a defunct proposed spec seems better than
* inventing our own.  As well as Xythos, Cosmo follows this specification,
* with some documented variations, which we will also follow.  In particular
* we use the xmlns="http://www.xythos.com/namespaces/StorageServer" rather
* than the DAV: namespace.
*
* @package   davical
* @subpackage   caldav
* @author    Andrew McMillan <andrew@mcmillan.net.nz>
* @copyright Morphoss Ltd - http://www.morphoss.com/
* @license   http://gnu.org/copyleft/gpl.html GNU GPL v2 or later
*/
dbg_error_log('MKTICKET', 'method handler');
require_once 'DAVResource.php';
$request->NeedPrivilege('DAV::bind');
require_once 'XMLDocument.php';
$reply = new XMLDocument(array('DAV:' => '', 'http://www.xythos.com/namespaces/StorageServer' => 'T'));
$target = new DAVResource($request->path);
if (!$target->Exists()) {
    $request->XMLResponse(404, new XMLElement('error', new XMLElement('resource-must-not-be-null'), $reply->GetXmlNsArray()));
}
if (!isset($request->xml_tags)) {
    $request->XMLResponse(400, new XMLElement('error', new XMLElement('missing-xml-for-request'), $reply->GetXmlNsArray()));
}
$xmltree = BuildXMLTree($request->xml_tags, $position);
if ($xmltree->GetTag() != 'http://www.xythos.com/namespaces/StorageServer:ticketinfo' && $xmltree->GetTag() != 'DAV::ticketinfo') {
    $request->XMLResponse(400, new XMLElement('error', new XMLElement('invalid-xml-for-request'), $reply->GetXmlNsArray()));
}
开发者ID:rossryan,项目名称:Calico,代码行数:31,代码来源:caldav-MKTICKET.php


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