예제 #1
0
파일: plugin.php 프로젝트: Efreak/YOURLS
function preAddLink($args)
{
    if (YOURLS_MULTIUSER_ANONYMOUS === true) {
        return;
    } else {
        $token = isset($_REQUEST['token']) ? yourls_sanitize_string($_REQUEST['token']) : '';
        $user = getUserIdByToken($token);
        if ($user == false) {
            $u = $_SESSION["user"];
            $user = getUserIdByToken($u["token"]);
        }
        if ($user == false) {
            echo yourls_notice_box("<b>You need to be logged to short a link.</b>");
            die;
        } else {
            return;
        }
    }
}
예제 #2
0
/**
 * Wrapper function to display admin notices
 *
 */
function yourls_add_notice($message, $style = 'notice')
{
    // Escape single quotes in $message to avoid breaking the anonymous function
    $message = yourls_notice_box(strtr($message, array("'" => "\\'")), $style);
    yourls_add_action('admin_notices', create_function('', "echo '{$message}';"));
}
예제 #3
0
function yourls_add_notice($message)
{
    $message = yourls_notice_box($message);
    yourls_add_action('admin_notices', create_function('', "echo '{$message}';"));
}
예제 #4
0
파일: form.php 프로젝트: Efreak/YOURLS
<?php

if (strpos($_SERVER["REQUEST_URI"], "form.php") === false) {
    if (YOURLS_PRIVATE === false || !defined('YOURLS_ABSPATH')) {
        die;
        // NO DIRECT CALLS IF PUBLIC OR if YOURLS_ABSPATH NOT DEFINED!
    }
    echo yourls_notice_box("<b>Log in</b>");
    mu_html_loginForm($error_msg);
} else {
}
예제 #5
0
파일: formjoin.php 프로젝트: Efreak/YOURLS
<?php

if (strpos($_SERVER["REQUEST_URI"], "formjoin.php") === false) {
    if (YOURLS_PRIVATE === false || !defined('YOURLS_ABSPATH')) {
        die;
        // NO DIRECT CALLS IF PUBLIC OR if YOURLS_ABSPATH NOT DEFINED!
    }
    echo yourls_notice_box("<b>Sign in</b>");
    mu_html_signupForm($error_msg);
} else {
}