示例#1
0
function SiteCredits_isActive()
{
    global $DBVARS;
    if (!isset($DBVARS['sitecredits-credits'])) {
        $DBVARS['sitecredits-credits'] = 0;
        Core_configRewrite();
    }
    if ($DBVARS['sitecredits-credits'] < -1) {
        echo '<p>' . __('Website Administrator attention needed.' . ' Please log into your administration area (and check your email).') . '</p>';
        Core_quit();
    }
}
示例#2
0
/**
 * install/de-install plugins
 *
 * @return array status
 */
function Core_adminPluginsSetInstalled()
{
    global $PLUGINS;
    // { get hidden plugins (those the admin installs manually)
    $tmp_hidden = array();
    foreach ($PLUGINS as $name => $plugin) {
        if (isset($plugin['hide_from_admin']) && $plugin['hide_from_admin']) {
            $tmp_hidden[] = $name;
        }
    }
    // }
    // { see what was added or removed
    $added = array();
    foreach ($_REQUEST['plugins'] as $name => $var) {
        if (!isset($PLUGINS[$name])) {
            $added[] = $name;
        }
    }
    $removed = array();
    foreach ($PLUGINS as $name => $var) {
        if (!isset($_REQUEST['plugins'][$name])) {
            $removed[] = $name;
        }
    }
    // }
    // { get changes from form
    $tmp = array();
    foreach ($_REQUEST['plugins'] as $name => $var) {
        if (file_exists(SCRIPTBASE . 'ww.plugins/' . $name . '/plugin.php')) {
            $tmp[] = $name;
        }
    }
    // }
    $plugins = array_merge($tmp, $tmp_hidden);
    $plugins = Core_adminPluginsDependenciesGet($plugins);
    if (is_array($plugins)) {
        $GLOBALS['DBVARS']['plugins'] = $plugins;
        Core_configRewrite();
        return array('ok' => 1, 'added' => $added, 'removed' => $removed);
    }
    Core_cacheClear();
    return array('ok' => 0);
}
示例#3
0
        }
        $files = glob($newdir . '/logo-*');
        foreach ($files as $f) {
            unlink($f);
        }
        CoreGraphics::convert($_FILES['site_logo']['tmp_name'], $newdir . '/logo.png');
    }
    $pageLengthLimit = $_REQUEST['site_page_length_limit'];
    if (!empty($pageLengthLimit) && is_numeric($pageLengthLimit)) {
        $DBVARS['site_page_length_limit'] = $pageLengthLimit;
    } else {
        if (isset($DBVARS['site_page_length_limit'])) {
            unset($DBVARS['site_page_length_limit']);
        }
    }
    Core_configRewrite();
    Core_cacheClear();
    echo '<em>' . __('options updated') . '</em>';
}
if ($action == 'remove_logo') {
    unlink(USERBASE . '/f/skin_files/logo.png');
}
// }
// { form
echo '<form method="post" action="siteoptions.php?page=general" enctype="mu' . 'ltipart/form-data"><input type="hidden" name="MAX_FILE_SIZE" value="999' . '9999" /><table>';
// { website title and subtitle
echo '<tr><th>' . __('Website Title') . '</th><td><input name="site_title" value="' . htmlspecialchars($DBVARS['site_title']) . '" /></td></tr>' . '<tr><th>' . __('Website Subtitle') . '</th><td><input name="site_subtitle" value="' . htmlspecialchars($DBVARS['site_subtitle']) . '" /></td></tr>';
// }
// { canonical domain name
$canonical_name = @$DBVARS['canonical_name'] ? ' value="' . htmlspecialchars($DBVARS['canonical_name']) . '"' : '';
echo '<tr><th>' . __('Canonical Domain Name') . '</th><td><input name="canonical_name" ' . 'placeholder="' . __('leave blank to accept multiple domain names') . '"' . $canonical_name . ' /></td></tr>';
示例#4
0
/**
 * add a subscriber to an addressbook
 *
 * @return array result
 */
function Sms_adminSubscribe()
{
    if (!isset($_REQUEST['email']) || !filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL) || !isset($_REQUEST['pass']) || !$_REQUEST['pass']) {
        return array('status' => 0, 'error' => 'email and password must be provided');
    }
    $url = 'http://textr.mobi/api.php?a=subscribe' . '&email=' . urlencode($_REQUEST['email']) . '&password='******'pass']);
    $res = file_get_contents($url);
    if ($res === false) {
        return array('status' => 0, 'error' => 'failed to contact textr.mobi. please wait a short while ' . 'and try again.');
    }
    $json = json_decode($res);
    if ($json->status) {
        // successful subscription. record details
        $DBVARS['sms_email'] = $_REQUEST['email'];
        $DBVARS['sms_password'] = $_REQUEST['pass'];
        Core_configRewrite();
    }
    return $json;
}