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


PHP opendb_logger函数代码示例

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


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

示例1: site_hminfo_install

function site_hminfo_install()
{
    $query = "CREATE TABLE site_hminfo (" . "\tid \t\tINTEGER(20) UNSIGNED NOT NULL," . "\tdvd_title \tVARCHAR(128)," . "\tstudio\t\tVARCHAR(30)," . "\treleased\tDATE," . "\tstatus \t\tVARCHAR(15)," . "\tsound \t\tVARCHAR(20)," . "\tversions\tVARCHAR(20)," . "\tprice\t\tDECIMAL(12,2)," . "\trating\t\tVARCHAR(5)," . "\tyear\t\tVARCHAR(5)," . "\tgenre\t\tVARCHAR(20)," . "\taspect\t\tVARCHAR(6)," . "\tupc\t\tVARCHAR(15)," . "\tdvd_releasedate DATE," . "\ttimestamp\tDATE," . "\tupdate_on\tTIMESTAMP," . "\tPRIMARY KEY ( id )" . ") ENGINE=MyISAM COMMENT='Home Theatre Info Lookup Table';";
    $create = db_query($query);
    if ($create) {
        opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, 'Table site_hminfo created');
        return TRUE;
    } else {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error());
        return FALSE;
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:12,代码来源:hminfo.install.class.php

示例2: delete_announcement

function delete_announcement($announcement_id)
{
    $query = "DELETE FROM announcement WHERE sequence_number = " . $announcement_id;
    $delete = db_query($query);
    if (db_affected_rows() > 0) {
        opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($announcement_id));
        return TRUE;
    } else {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($announcement_id));
        return FALSE;
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:12,代码来源:functions.php

示例3: __perform_install_table_batch

 function __perform_install_table_batch()
 {
     if (file_exists("./admin/s_site_plugin/sql/" . $this->_job . ".install.class.php")) {
         $classname = "Install_" . $this->_job;
         include_once "./admin/s_site_plugin/sql/" . $this->_job . ".install.class.php";
         $installPlugin = new $classname();
         // this is currently the only type we support.
         if ($installPlugin->getInstallType() == 'Install_Table') {
             if (check_opendb_table($installPlugin->getInstallTable())) {
                 if ($this->_batchlimit > 0) {
                     $fh = @fopen('./admin/s_site_plugin/upload/' . $this->_uploadFile, 'rb');
                     if ($fh !== FALSE) {
                         $installPlugin->setRowRange($this->_completed + 1, $this->_completed + $this->_batchlimit);
                         if (($header_row = fgetcsv($fh, 4096, ",")) !== FALSE) {
                             $installPlugin->_handleRow($header_row);
                         }
                         while (!$installPlugin->isEndRowFound() && ($read_row_r = fgetcsv($fh, 4096, ",")) !== FALSE) {
                             $installPlugin->_handleRow($read_row_r);
                         }
                         fclose($fh);
                         $this->_processed = $installPlugin->getProcessedCount();
                         $this->_completed = $installPlugin->getRowCount();
                     } else {
                         opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Upload file not accessible');
                         return FALSE;
                     }
                 } else {
                     return FALSE;
                 }
             } else {
                 opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Plugin table ' . strtoupper($installPlugin->getInstallTable()) . ' does not exist');
                 return FALSE;
             }
         } else {
             return FALSE;
         }
     } else {
         opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Site Plugin installation maintenance class not found');
         return FALSE;
     }
 }
开发者ID:horrabin,项目名称:opendb,代码行数:41,代码来源:InstallTableAjaxJobs.class.php

示例4: update_role_permissions

function update_role_permissions($role_name, $permissions_r)
{
    $role_name = addslashes($role_name);
    db_query("DELETE FROM s_role_permission WHERE role_name = '{$role_name}'");
    if (strlen($role_name) > 0 && is_array($permissions_r)) {
        reset($permissions_r);
        while (list($permission_name, $permission_r) = each($permissions_r)) {
            $enabled_ind = validate_ind_column($permission_r['enabled_ind']);
            $remember_me_ind = validate_ind_column($permission_r['remember_me_ind']);
            if ($enabled_ind == 'Y') {
                $query = "INSERT INTO s_role_permission(role_name, permission_name, remember_me_ind) \n\t\t\t\t\tVALUES('{$role_name}', '{$permission_name}', '" . $remember_me_ind . "')";
                $insert = db_query($query);
                if ($insert && db_affected_rows() > 0) {
                    opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, NULL, array($role_name, $permission_name, $remember_me_ind));
                } else {
                    opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($role_name, $permission_name, $remember_me_ind));
                }
            }
        }
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:21,代码来源:functions.php

示例5: opendb_redirect

/**
 * Simple HTTTP Location redirect
 *
 * A simple function to redirect browsers via the HTTP Location header.
 *
 * @param string $link The URL to redirect the user's browser to
 */
function opendb_redirect($link)
{
    if (!is_url_absolute($link)) {
        $protocol = 'http';
        if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
            $protocol = 'https';
        }
        $host = $_SERVER['HTTP_HOST'];
        // fix for windows
        $path = str_replace('\\', '/', dirname($_SERVER['PHP_SELF']));
        if (substr($path, -1, 1) != '/') {
            $path .= '/';
        }
        $path .= $link;
        $url = $protocol . '://' . $host . $path;
        opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($link, $url));
        header('Location: ' . $url);
    } else {
        opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($link));
        header("Location: {$link}");
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:29,代码来源:http.php

示例6: OpenDbMailer

 function OpenDbMailer($mailer)
 {
     $this->PluginDir = './lib/phpmailer/';
     if (get_opendb_config_var('email', 'windows_smtp_server') === TRUE) {
         $this->LE = "\r\n";
     } else {
         $this->LE = "\n";
     }
     $this->Mailer = $mailer;
     $this->Priority = "3";
     // in case we want to change it
     $this->Sender = get_opendb_config_var('email', 'noreply_address');
     if ($this->Mailer == 'smtp') {
         $email_smtp_r = get_opendb_config_var('email.smtp');
         // at least host should be defined.
         if (is_not_empty_array($email_smtp_r) && strlen($email_smtp_r['host']) > 0) {
             $this->Host = $email_smtp_r['host'];
             if (strlen($email_smtp_r['port']) > 0) {
                 $this->Port = $email_smtp_r['port'];
             }
             if ($email_smtp_r['secure'] != 'none') {
                 $this->SMTPSecure = $email_smtp_r['secure'];
                 // sets the prefix to the server
             }
             if (strlen($email_smtp_r['username']) > 0 && strlen($email_smtp_r['password']) > 0) {
                 $this->Username = $email_smtp_r['username'];
                 $this->Password = $email_smtp_r['password'];
                 $this->SMTPAuth = TRUE;
             }
         } else {
             // set to 'mail' mailer as default, and log configuration error.
             opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Email SMTP Configuration missing', array($mailer));
             // override, because mailer smtp is misconfigured.
             $this->Mailer = 'mail';
         }
     }
 }
开发者ID:horrabin,项目名称:opendb,代码行数:37,代码来源:opendbmailer.class.php

示例7: db_remove_all_interest_level

function db_remove_all_interest_level($user_id)
{
    $query = "DELETE FROM user_item_interest" . " WHERE user_id = '{$user_id}'";
    $update = db_query($query);
    // We should not treat updates that were not actually updated because value did not change as failures.
    $rows_affected = db_affected_rows();
    if ($update && $rows_affected !== -1) {
        if ($rows_affected > 0) {
            opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($user_id));
        }
        return TRUE;
    } else {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($user_id));
        return FALSE;
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:16,代码来源:interest.php

示例8: delete_author_reviews

function delete_author_reviews($author_id)
{
    $query = "DELETE FROM review WHERE author_id = '{$author_id}'";
    $delete = db_query($query);
    // doesn't matter if no items deleted, as long as operation was successful.
    if ($delete) {
        opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($author_id));
        return TRUE;
    } else {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($author_id));
        return FALSE;
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:13,代码来源:review.php

示例9: handle_item_relation_delete

function handle_item_relation_delete($item_r, $status_type_r, $HTTP_VARS, &$errors)
{
    if ($item_r['owner_id'] != get_opendb_session_var('user_id') && !is_user_granted_permission(PERM_ITEM_ADMIN)) {
        $errors = array('error' => get_opendb_lang_var('cannot_delete_relation_item_not_owned'), 'detail' => '');
        opendb_logger(OPENDB_LOG_WARN, __FILE__, __FUNCTION__, 'User to delete item relationship they do not own', $item_r);
        return FALSE;
    }
    if ($HTTP_VARS['confirmed'] == 'true') {
        delete_related_item_instance_relationship($item_r['item_id'], $item_r['instance_no'], $HTTP_VARS['parent_item_id'], $HTTP_VARS['parent_instance_no']);
    } else {
        if ($HTTP_VARS['confirmed'] != 'false') {
            return "__CONFIRM__";
        } else {
            // confirmation required.
            return "__ABORTED__";
        }
    }
}
开发者ID:robboor,项目名称:opendb,代码行数:18,代码来源:item_input.php

示例10: perform_newpassword

function perform_newpassword($HTTP_VARS, &$errors)
{
    if (!is_user_valid($HTTP_VARS['uid'])) {
        opendb_logger(OPENDB_LOG_WARN, __FILE__, __FUNCTION__, 'New password request failure: User does not exist', array($HTTP_VARS['uid']));
        // make user look successful to prevent mining for valid userids
        return TRUE;
    } else {
        if (!is_user_active($HTTP_VARS['uid'])) {
            // Do not allow new password operation for 'deactivated' user.
            opendb_logger(OPENDB_LOG_WARN, __FILE__, __FUNCTION__, 'New password request failure: User is not active', array($HTTP_VARS['uid']));
            return FALSE;
        } else {
            if (!is_user_granted_permission(PERM_CHANGE_PASSWORD, $HTTP_VARS['uid'])) {
                opendb_logger(OPENDB_LOG_WARN, __FILE__, __FUNCTION__, 'New password request failure: User does not have permission to change password', array($HTTP_VARS['uid']));
                return FALSE;
            } else {
                if (get_opendb_config_var('user_admin', 'user_passwd_change_allowed') === FALSE && !is_user_granted_permission(PERM_ADMIN_CHANGE_PASSWORD)) {
                    opendb_logger(OPENDB_LOG_WARN, __FILE__, __FUNCTION__, 'New password request failure: Password change is disabled', array($HTTP_VARS['uid']));
                    return FALSE;
                } else {
                    opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, 'User requested to be emailed a new password', array($HTTP_VARS['uid']));
                    $user_r = fetch_user_r($HTTP_VARS['uid']);
                    $user_passwd = generate_password(8);
                    // only send if valid user (email)
                    if (strlen($user_r['email_addr']) > 0) {
                        $pass_result = update_user_passwd($HTTP_VARS['uid'], $user_passwd);
                        if ($pass_result === TRUE) {
                            $subject = get_opendb_lang_var('lost_password');
                            $message = get_opendb_lang_var('to_user_email_intro', 'fullname', $user_r['fullname']) . "\n\n" . get_opendb_lang_var('new_passwd_email') . "\n\n" . get_opendb_lang_var('userid') . ": " . $HTTP_VARS['uid'] . "\n" . get_opendb_lang_var('password') . ": " . $user_passwd;
                            if (opendb_user_email($user_r['user_id'], NULL, $subject, $message, $errors)) {
                                return TRUE;
                            } else {
                                return "EMAIL_NOT_SENT";
                            }
                        }
                    } else {
                        $errors[] = "User '" . $HTTP_VARS['uid'] . "' does not have a valid email address.";
                        return FALSE;
                    }
                }
            }
        }
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:44,代码来源:login.php

示例11: delete_s_language

function delete_s_language($language)
{
    if (is_exists_language($language)) {
        $query = "DELETE FROM s_language " . "WHERE language = '{$language}'";
        $delete = db_query($query);
        // We should not treat deletes that were not actually updated because value did not change as failures.
        if ($delete && ($rows_affected = db_affected_rows()) !== -1) {
            if ($rows_affected > 0) {
                opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($language));
            }
            return TRUE;
        } else {
            opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($language));
            return FALSE;
        }
    }
    //else
    return FALSE;
}
开发者ID:horrabin,项目名称:opendb,代码行数:19,代码来源:functions.php

示例12: insert_email

/**
 * The table structure could be more sophisticated where a message is sent to multiple
 * addresses, but since the email function does not provide this, I see no reason to
 * do anything more complicated.
 *
 * @param unknown_type $item_id
 * @param unknown_type $author_id
 * @param unknown_type $comment
 * @param unknown_type $rating
 * @return unknown
 */
function insert_email($to_user_id, $from_user_id, $from_email_addr, $subject, $message)
{
    $to_user_id = trim($to_user_id);
    $from_user_id = trim($from_user_id);
    $from_email_addr = trim($from_email_addr);
    if (!is_user_valid($to_user_id)) {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Invalid To User', array($to_user_id, $from_user_id, $from_email_addr, $subject));
        return FALSE;
    } else {
        if (strlen($from_user_id) > 0 && !is_user_valid($from_user_id)) {
            opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Invalid From User', array($to_user_id, $from_user_id, $from_email_addr, $subject));
            return FALSE;
        } else {
            if (strlen($from_user_id) == 0 && (strlen($from_email_addr) == 0 || !is_valid_email_addr($from_email_addr))) {
                opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, 'Invalid From Email', array($to_user_id, $from_user_id, $from_email_addr, $subject));
                return FALSE;
            }
        }
    }
    if (strlen($from_user_id) > 0) {
        $from_email_addr = NULL;
    } else {
        $from_email_addr = addslashes($from_email_addr);
    }
    $subject = addslashes(trim($subject));
    $message = addslashes(replace_newlines(trim($message)));
    $query = "INSERT INTO mailbox (to_user_id,from_user_id,from_email_addr,subject,message)" . "VALUES ('{$to_user_id}'," . (strlen($from_user_id) > 0 ? "'{$from_user_id}'" : "NULL") . "," . (strlen($from_email_addr) > 0 ? "'{$from_email_addr}'" : "NULL") . ", '{$subject}','{$message}')";
    $insert = db_query($query);
    if ($insert && db_affected_rows() > 0) {
        opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($to_user_id, $from_user_id, $from_email_addr, $subject));
        return TRUE;
    } else {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($to_user_id, $from_user_id, $from_email_addr, $subject));
        return FALSE;
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:47,代码来源:email.php

示例13: delete_s_config_group_item_vars

/**
 */
function delete_s_config_group_item_vars($group_id, $id, $keyid)
{
    if (strlen($group_id) > 0) {
        $query = "DELETE FROM s_config_group_item_var " . "WHERE group_id = '{$group_id}'";
        if (strlen($id) > 0) {
            $query .= " AND id = '{$id}'";
        }
        if (strlen($keyid) > 0) {
            $query .= " AND keyid = '{$keyid}'";
        }
        $delete = db_query($query);
        // We should not treat deletes that were not actually updated because value did not change as failures.
        if ($delete && ($rows_affected = db_affected_rows()) !== -1) {
            //if($rows_affected>0)
            //	opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($group_id, $id, $keyid));
            return TRUE;
        } else {
            opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($group_id, $id, $keyid));
            return FALSE;
        }
    }
    //else
    return FALSE;
}
开发者ID:horrabin,项目名称:opendb,代码行数:26,代码来源:functions.php

示例14: import_cache_deleteall

function import_cache_deleteall()
{
    // hack
    import_cache_get_cache_directory();
    if (db_query("LOCK TABLES import_cache WRITE")) {
        $query = "SELECT sequence_number FROM import_cache";
        $results = db_query($query);
        if ($results) {
            while ($import_cache_r = db_fetch_assoc($results)) {
                import_cache_delete($import_cache_r['sequence_number']);
            }
            db_free_result($results);
        }
        db_query("UNLOCK TABLES");
    } else {
        opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error());
        return FALSE;
    }
}
开发者ID:horrabin,项目名称:opendb,代码行数:19,代码来源:importcache.php

示例15: delete_s_title_display_mask_item

/**
 */
function delete_s_title_display_mask_item($stdm_id, $s_item_type_group, $s_item_type)
{
    if (strlen($stdm_id) > 0 && strlen($s_item_type_group) > 0 && strlen($s_item_type) > 0) {
        // ensure parent record exists
        if (is_exists_s_title_display_mask($stdm_id)) {
            $query = "DELETE FROM s_title_display_mask_item " . " WHERE stdm_id = '{$stdm_id}' AND " . "s_item_type_group = '{$s_item_type_group}' AND " . "s_item_type = '{$s_item_type}'";
            $delete = db_query($query);
            // We should not treat deletes that were not actually updated because value did not change as failures.
            if ($delete && ($rows_affected = db_affected_rows()) !== -1) {
                if ($rows_affected > 0) {
                    opendb_logger(OPENDB_LOG_INFO, __FILE__, __FUNCTION__, NULL, array($stdm_id, $s_item_type_group, $s_item_type));
                }
                return TRUE;
            } else {
                opendb_logger(OPENDB_LOG_ERROR, __FILE__, __FUNCTION__, db_error(), array($stdm_id, $s_item_type_group, $s_item_type));
                return FALSE;
            }
        }
    }
    //else
    return FALSE;
}
开发者ID:horrabin,项目名称:opendb,代码行数:24,代码来源:functions.php


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