Example #1
0
function display_access_tokens($aweber)
{
    if (isset($_GET['oauth_token']) && isset($_GET['oauth_verifier'])) {
        //print_r($aweber);
        $aweber->user->requestToken = $_GET['oauth_token'];
        $aweber->user->verifier = $_GET['oauth_verifier'];
        $aweber->user->tokenSecret = $_COOKIE['secret'];
        list($accessTokenKey, $accessTokenSecret) = $aweber->getAccessToken();
        $account = $aweber->getAccount($accessTokenKey, $accessTokenSecret);
        //echo $account->data["id"];
        print "AWEBER_ACCOUNT_ID = " . $account->data["id"] . "\n<br>" . "AWEBER_ACCESS_KEY = '{$accessTokenKey}';\n<br>" . "AWEBER_ACCESS_SECRET = '{$accessTokenSecret}';\n<br>" . "<br><br>";
        $listURL = "/accounts/" . $account->data["id"] . "/lists/";
        $lists = $account->loadFromUrl($listURL);
        foreach ($lists->data['entries'] as $list) {
            print "AWEBER_LIST_ID = {$list['id']} // list name:{$list['name']}\n</br>";
        }
        exit;
    }
    if (!isset($_SERVER['HTTP_USER_AGENT'])) {
        print "This request must be made from a web browser\n";
        exit;
    }
    $callbackURL = get_self();
    list($key, $secret) = $aweber->getRequestToken($callbackURL);
    $authorizationURL = $aweber->getAuthorizeUrl();
    setcookie('secret', $secret);
    header("Location: {$authorizationURL}");
    exit;
}
Example #2
0
 function auth()
 {
     if (isset($GLOBALS['pass']) && trim($GLOBALS['pass']) != '') {
         $c = $_COOKIE;
         $p = $_POST;
         if (isset($p['pass'])) {
             $your_pass = sha1(md5($p['pass']));
             if ($your_pass == $GLOBALS['pass']) {
                 setcookie("pass", $your_pass, time() + 36000, "/");
                 header("Location: " . get_self());
             }
         }
         if (!isset($c['pass']) || isset($c['pass']) && $c['pass'] != $GLOBALS['pass']) {
             $res = "<!doctype html> <html> <head> <meta charset='utf-8'> <meta name='robots' content='noindex, nofollow, noarchive'> <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, user-scalable=0'> </head> <body style='background:#f8f8f8;color:#000000;padding:0;margin:0;'><br><p><center><noscript>You need to enable javascript</noscript></center></p> <script type='text/javascript'> var d = document; d.write(\"<br><br><form method='post'><center><input type='password' id='pass' name='pass' style='font-size:34px;width:34%;outline:none;text-align:center;background:#ffffff;padding:8px;border:1px solid #cccccc;border-radius:8px;color:#000000;'></center></form>\"); d.getElementById('pass').focus(); d.getElementById('pass').setAttribute('autocomplete', 'off'); </script> </body></html> ";
             echo $res;
             die;
         }
     }
 }
 function auth()
 {
     if (isset($GLOBALS['pass']) && trim($GLOBALS['pass']) != '') {
         $c = $_COOKIE;
         $p = $_POST;
         if (isset($p['pass'])) {
             $your_pass = sha1(md5($p['pass']));
             if ($your_pass == $GLOBALS['pass']) {
                 setcookie("pass", $your_pass);
                 $res = "\n\t\t<script type='text/javascript'>\n\t\tlocation.href='" . get_self() . "';\n\t\t</script>\n\t\t";
                 echo $res;
             }
         }
         if (!isset($c['pass']) || isset($c['pass']) && $c['pass'] != $GLOBALS['pass']) {
             $res = "\n\t\t<body style='background:#f8f8f8;color:#000000;padding:0;margin:0;'><br><p><center><noscript>You need to enable javascript</noscript></center></p>\n\t\t<script type='text/javascript'>\n\t\tvar d = document;\n\t\td.write(\"<br><br><form method='post'><center><input type='password' id='pass' name='pass' style='font-size:13px;width:144px;outline:none;text-align:center;background:#ffffff;padding:8px;border:1px solid #cccccc;border-radius:8px;color:#000000;'></center></form>\");\n\t\td.getElementById('pass').focus();\n\t\td.getElementById('pass').setAttribute('autocomplete', 'off');\n\t\t</script>\n\t\t</body>\n\t\t";
             echo $res;
             die;
         }
     }
 }
Example #4
0
function footer($update_info = null)
{
    $self = get_self();
    $year = date("Y");
    echo "</div>";
    echo "<div id=\"footer\">" . "Copyright ionCube Ltd. 2002-{$year} | " . "Loader Wizard version " . script_version() . " ";
    if ($update_info === true) {
        $update_info = check_for_wizard_update(false);
    }
    $wizard_version_string = '(';
    if ($update_info === null) {
        $wizard_version_string .= '<a href="' . LOADERS_PAGE . '">check for new version</a>';
    } else {
        if ($update_info !== false) {
            $wizard_version_string .= '<a href="' . LOADERS_PAGE . '">download version ' . $update_info . '</a>';
        } else {
            $wizard_version_string .= "current";
        }
    }
    $wizard_version_string .= ')';
    echo $wizard_version_string;
    echo " | <a href=\"{$self}?page=phpinfo\" target=\"phpinfo\">phpinfo</a>";
    echo " | <a href=\"{$self}?page=phpconfig\" target=\"phpconfig\">config</a>";
    echo " | <a href=\"{$self}\">wizard start</a>";
    echo " | <a href=\"{$self}?page=loader_check\">loader test</a>";
    echo ' | <a href="' . LOADERS_PAGE . '" target="loaders">Loaders</a>';
    echo "</div>\n";
    echo "\n</body></html>\n";
}
Example #5
0
    $parameter = 'action=photo&doing=view_photo&photo_id=7&';
    $pagebar = pagebar(get_self(), $parameter, $page_current, $page_size, $count);
    $smarty = new smarty();
    smarty_header();
    $smarty->assign('pagebar', $pagebar);
    $smarty->assign('photo', $rows);
    $smarty->display('admin_photo_list.html');
}
if ($doing == 'manage_photo') {
    check_browser();
    check_user();
    $format = "SELECT * FROM `{$db_prefix}photo`";
    $query = $db->query($format);
    $page_size = 10;
    $page_current = isset($_GET['page']) && is_numeric($_GET['page']) ? intval($_GET['page']) : 1;
    $count = $db->getCount($format);
    $res = $db->getAll($format . " LIMIT " . ($page_current - 1) * $page_size . "," . $page_size);
    $rows = array();
    if ($count > 1) {
        foreach ($res as $value) {
            $rows[] = $value;
        }
    }
    $parameter = 'action=photo&doing=manage_photo&';
    $pagebar = pagebar(get_self(), $parameter, $page_current, $page_size, $count);
    $smarty = new smarty();
    smarty_header();
    $smarty->assign('pagebar', $pagebar);
    $smarty->assign('photo', $rows);
    $smarty->display('admin_manage_photo.html');
}
function footer($update_info = null)
{
    $self = get_self();
    $base = get_base_address();
    $default = get_default_address(false);
    $year = gmdate("Y");
    echo "</div>";
    echo "<div id=\"footer\">" . "Copyright ionCube Ltd. 2002-{$year} | " . "Loader Wizard version " . script_version() . " ";
    if ($update_info === true) {
        $update_info = check_for_wizard_update(false);
    }
    $loader_wizard_loc = LOADER_WIZARD_URL;
    $wizard_version_string = <<<EOT
    <script type="text/javascript">
    var xmlhttp;
    function version_check()
    { 
        var body = document.getElementsByTagName('body')[0];
        var ldel = document.getElementById('loading');
        if (!ldel) {
            body.innerHTML += '<div id="loading"></div>';
            ldel = document.getElementById('loading');
        }
        ldel.innerHTML = '<p>Retrieving Wizard version information<br>Please wait</p>';
        ldel.style.display = 'block';
        ldel.style.height = '300px';
        ldel.style.left = '200px';
        ldel.style.border = '4px #660000 solid';
        if (window.XMLHttpRequest) {
            xmlhttp=new XMLHttpRequest();
        } else {
            xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
        }
        xmlhttp.onreadystatechange=function()
        {
            var loadedOkay = 0;
            if (xmlhttp.readyState==4 && xmlhttp.status==200)
            {
                var wizardversion = xmlhttp.responseText;
                var msg;
                clearTimeout(xmlHttpTimeout);
                buttons = '';
                if (wizardversion == '1') {
                    msg = 'You have the current version of the<br>ionCube Loader Wizard'; 
                } else if (wizardversion != '0') {
                    msg = 'A new version, ' + wizardversion + ', of the loader wizard is available';
                    buttons = '<button onclick="document.getElementById(\\'loading\\').style.display=\\'none\\'; window.open(\\'{$loader_wizard_loc}\\'); return false">Get new version</button> &nbsp;'; 
                } else {
                    msg = 'Wizard version information cannot be obtained from the<br>ionCube server';
                }
                buttons += '<button onclick="document.getElementById(\\'loading\\').style.display=\\'none\\'; return false">Close this box</button>'; 
                ldel.innerHTML = '<p>' + msg +  '<br>' + buttons + '</p>';
            }
        }
        xmlhttp.open("GET",'{$self}?page=wizardversion&wizard_only=1&clear_info=1',true);
        xmlhttp.send();
        var xmlHttpTimeout=setTimeout(ajaxTimeout,7000);
    }
    function ajaxTimeout(){
       xmlhttp.abort();
       msg = 'Wizard version information cannot be obtained from the<br>ionCube server';
       button = '<button onclick="document.getElementById(\\'loading\\').style.display=\\'none\\'; return false">Close this box</button>';
       var ldel = document.getElementById('loading');
       ldel.innerHTML = '<p>' + msg +  '<br>' + button + '</p>';
    }
    </script>
EOT;
    $wizard_version_string .= '(';
    if ($update_info === null) {
        $wizard_version_string .= '<a target="_blank" href="' . $loader_wizard_loc . '" onclick="version_check();return false;">check for new version</a>';
    } else {
        if ($update_info !== false) {
            $wizard_version_string .= '<a href="' . LOADERS_PAGE . '" target="_blank">download version ' . $update_info . '</a>';
        } else {
            $wizard_version_string .= "current";
        }
    }
    $wizard_version_string .= ')';
    echo $wizard_version_string;
    $server_type_code = server_type_code();
    if (!info_should_be_disabled()) {
        echo " | <a href=\"{$base}&amp;page=phpinfo\" target=\"phpinfo\">phpinfo</a>";
        echo " | <a href=\"{$base}&amp;page=phpconfig\" target=\"phpconfig\">config</a>";
        echo " | <a href=\"{$base}&amp;page=extra&amp;stype={$server_type_code}\" target=\"extra\">additional</a>";
        echo " | <a href=\"{$base}&amp;page=system_info_archive&amp;stype={$server_type_code}\">info archive</a>";
    }
    echo " | <a href=\"{$default}\" onclick=\"showOverlay();\">wizard start</a>";
    echo " | <a href=\"{$base}&amp;page=loader_check\" onclick=\"showOverlay();\">loader test</a>";
    echo ' | <a href="' . LOADERS_PAGE . '" target="loaders">loaders</a>';
    echo "</div>\n";
    echo "\n</body></html>\n";
}
Example #7
0
</div>
<!--wrapper end-->
<div id='navigation'>
	<div id='totop'></div>
	<div id='tobottom'></div>
</div>
<table id="overlay"><tr><td><div id="loading" ondblclick='loading_stop();'></div></td></tr></table>
<form action='<?php 
echo get_self();
?>
' method='post' id='form' target='_blank'></form>
<!--script start-->
<script type='text/javascript'>
var targeturl = '<?php 
echo get_self();
?>
';
var module_to_load = '<?php 
echo implode(",", $GLOBALS['module_to_load']);
?>
';
var win = <?php 
echo is_win() ? 'true' : 'false';
?>
;
var init_shell = true;
<__ZEPTO__>
<__JS__>

<?php 
Example #8
0
    $smarty->display('login.html');
}
//登陆检测
if ($doing == 'login') {
    $admin_name = empty($_POST['userName']) ? '' : trim($_POST['userName']);
    $admin_pass = empty($_POST['userPassword']) ? '' : trim($_POST['userPassword']);
    $admin_pass = md5($admin_pass);
    if (empty($admin_name)) {
        message(array('text' => $language['admin_name_is_empty'], 'link' => ''));
    }
    if (empty($admin_pass)) {
        message(array('text' => $language['admin_password_is_empty'], 'link' => ''));
    }
    $format = "SELECT * FROM %sadmin WHERE `admin_name`='%s' AND `admin_password`='%s'";
    $fromat = sprintf($format, $db_prefix, $admin_name, $admin_pass);
    $result = $db->query($fromat);
    $row = $result->fetch_assoc();
    if (is_array($row)) {
        $_SESSION['admin_id'] = $row['admin_id'];
        $_SESSION['admin_name'] = $row['admin_name'];
        message(array('text' => $language['login_is_success'], 'link' => '?action=start'));
    } else {
        message(array('text' => $language['login_is_failure'], 'link' => ''));
    }
}
//退出登陆
if ($do == 'logout') {
    unset($_SESSION['admin_id'], $_SESSION['admin_name']);
    smarty_cache();
    message(array('text' => $language['logout_is_success'], 'link' => get_self()));
}
Example #9
0
function check_user()
{
    if (empty($_SESSION['admin_id'])) {
        message(array('text' => $GLOBALS['language']['please_login'], 'link' => get_self()));
    }
}
 function display_access_tokens($aweber)
 {
     if (isset($_GET['oauth_token']) && isset($_GET['oauth_verifier'])) {
         $aweber->user->requestToken = $_GET['oauth_token'];
         $aweber->user->verifier = $_GET['oauth_verifier'];
         $aweber->user->tokenSecret = $_COOKIE['secret'];
         list($accessTokenKey, $accessTokenSecret) = $aweber->getAccessToken();
         //print "Please add these lines of code to the top of your script:<br><br>" .
         //        "\$accessKey = '{$accessTokenKey}';\n<br>" .
         //        "\$accessSecret = '{$accessTokenSecret}';\n<br>" .
         //        "<br><br>" .
         //        "Then click <a href=\"" . get_self() . "\">here</a> to continue";
         //exit;
     }
     if (!isset($_SERVER['HTTP_USER_AGENT'])) {
         //print "This request must be made from a web browser\n";
         //exit;
     }
     $callbackURL = get_self();
     list($key, $secret) = $aweber->getRequestToken($callbackURL);
     $authorizationURL = $aweber->getAuthorizeUrl();
     setcookie('secret', $secret);
     header("Location: {$authorizationURL}");
     exit;
 }