コード例 #1
0
ファイル: index.php プロジェクト: jth131/jappix
*/
// PHP base
define('JAPPIX_BASE', '.');
// Get the function files
require_once './server/functions.php';
// Get the configuration
require_once './server/read-main.php';
require_once './server/read-hosts.php';
// Get some extra-libs
require_once './server/gettext.php';
// Prepare application
enableErrorSink();
hideErrors();
compressThis();
// Include the good language file
$locale = checkLanguage();
includeTranslation($locale, 'main');
// Get the Jappix version & its hash
$version = getVersion();
$hash = genHash($version);
// Include the good application file
$include_app = 'desktop';
// App to include?
if (!isInstalled()) {
    // Not yet installed
    $include_app = 'install';
} else {
    if (anonymousMode()) {
        // Anonymous
        $include_app = 'desktop';
    } else {
コード例 #2
0
/**
 * @param $filename Filename containing the extension i18n
 * @param $arrayname The name of the array in the filename
 * @param $filter Optional, restrict check to a given language code (default; null)
 */
function checkExtensionLanguage($filename, $arrayname, $filter = null)
{
    $extLanguages = new extensionLanguages($filename, $arrayname);
    $langs = $extLanguages->getLanguages();
    if (!$langs) {
        print "ERROR> \${$arrayname} array does not exist.\n";
        return false;
    }
    $nErrors = 0;
    if ($filter) {
        $nErrors += checkLanguage($extLanguages, $filter);
    } else {
        print "Will check " . count($langs) . " languages : " . implode(' ', $langs) . ".\n";
        foreach ($langs as $lang) {
            if ($lang == 'en') {
                #print "Skipped english language\n";
                continue;
            }
            $nErrors += checkLanguage($extLanguages, $lang);
        }
    }
    return $nErrors;
}
コード例 #3
0
ファイル: ADMIN.php プロジェクト: hatone/Nucleus-v3.64
 /**
  * @todo document this
  */
 function action_changemembersettings()
 {
     global $member, $CONF, $manager;
     $memberid = intRequestVar('memberid');
     // check if allowed
     $member->getID() == $memberid or $member->isAdmin() or $this->disallow();
     $name = trim(strip_tags(postVar('name')));
     $realname = trim(strip_tags(postVar('realname')));
     $password = postVar('password');
     $repeatpassword = postVar('repeatpassword');
     $email = strip_tags(postVar('email'));
     $url = strip_tags(postVar('url'));
     # replaced eregi() below with preg_match(). ereg* functions are deprecated in PHP 5.3.0
     # original eregi: !eregi("^https?://", $url)
     // begin if: sometimes user didn't prefix the URL with http:// or https://, this cause a malformed URL. Let's fix it.
     if (!preg_match('#^https?://#', $url)) {
         $url = 'http://' . $url;
     }
     $admin = postVar('admin');
     $canlogin = postVar('canlogin');
     $notes = strip_tags(postVar('notes'));
     $deflang = postVar('deflang');
     $mem = MEMBER::createFromID($memberid);
     if ($CONF['AllowLoginEdit'] || $member->isAdmin()) {
         if (!isValidDisplayName($name)) {
             $this->error(_ERROR_BADNAME);
         }
         if ($name != $mem->getDisplayName() && MEMBER::exists($name)) {
             $this->error(_ERROR_NICKNAMEINUSE);
         }
         if ($password != $repeatpassword) {
             $this->error(_ERROR_PASSWORDMISMATCH);
         }
         if ($password && strlen($password) < 6) {
             $this->error(_ERROR_PASSWORDTOOSHORT);
         }
         if ($password) {
             $pwdvalid = true;
             $pwderror = '';
             $manager->notify('PrePasswordSet', array('password' => $password, 'errormessage' => &$pwderror, 'valid' => &$pwdvalid));
             if (!$pwdvalid) {
                 $this->error($pwderror);
             }
         }
     }
     if (!isValidMailAddress($email)) {
         $this->error(_ERROR_BADMAILADDRESS);
     }
     if (!$realname) {
         $this->error(_ERROR_REALNAMEMISSING);
     }
     if ($deflang != '' && !checkLanguage($deflang)) {
         $this->error(_ERROR_NOSUCHLANGUAGE);
     }
     // check if there will remain at least one site member with both the logon and admin rights
     // (check occurs when taking away one of these rights from such a member)
     if (!$admin && $mem->isAdmin() && $mem->canLogin() || !$canlogin && $mem->isAdmin() && $mem->canLogin()) {
         $r = sql_query('SELECT * FROM ' . sql_table('member') . ' WHERE madmin=1 and mcanlogin=1');
         if (sql_num_rows($r) < 2) {
             $this->error(_ERROR_ATLEASTONEADMIN);
         }
     }
     if ($CONF['AllowLoginEdit'] || $member->isAdmin()) {
         $mem->setDisplayName($name);
         if ($password) {
             $mem->setPassword($password);
         }
     }
     $oldEmail = $mem->getEmail();
     $mem->setRealName($realname);
     $mem->setEmail($email);
     $mem->setURL($url);
     $mem->setNotes($notes);
     $mem->setLanguage($deflang);
     // only allow super-admins to make changes to the admin status
     if ($member->isAdmin()) {
         $mem->setAdmin($admin);
         $mem->setCanLogin($canlogin);
     }
     $autosave = postVar('autosave');
     $mem->setAutosave($autosave);
     $mem->write();
     // store plugin options
     $aOptions = requestArray('plugoption');
     NucleusPlugin::_applyPluginOptions($aOptions);
     $manager->notify('PostPluginOptionsUpdate', array('context' => 'member', 'memberid' => $memberid, 'member' => &$mem));
     // if email changed, generate new password
     if ($oldEmail != $mem->getEmail()) {
         $mem->sendActivationLink('addresschange', $oldEmail);
         // logout member
         $mem->newCookieKey();
         // only log out if the member being edited is the current member.
         if ($member->getID() == $memberid) {
             $member->logout();
         }
         $this->action_login(_MSG_ACTIVATION_SENT, 0);
         return;
     }
     if ($mem->getID() == $member->getID() && $mem->getDisplayName() != $member->getDisplayName()) {
         $mem->newCookieKey();
         $member->logout();
         $this->action_login(_MSG_LOGINAGAIN, 0);
     } else {
         $this->action_overview(_MSG_SETTINGSCHANGED);
     }
 }
コード例 #4
0
<?php

ob_start();
session_start();
require 'functions/functions.php';
checkLanguage();
ob_end_flush();
$_SESSION["page"] = "roster";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="description" content="<?php 
echo $description[$_SESSION["page"]];
?>
" />
    <title><?php 
echo $title[$_SESSION["page"]];
?>
</title>
		<script src="js/jquery-1.4.2.min.js" type="text/javascript" ></script>
		<script src="js/jquery-ui-1.8.4.custom.min.js" type="text/javascript" ></script>
    <?php 
if (isset($_SESSION['status']) && $_SESSION['status'] == 'admin') {
    ?>
		<script src="js/slide-admin.js" type="text/javascript"></script>
    <?php 
} else {
    ?>
		<script src="js/slide.js" type="text/javascript"></script>
コード例 #5
0
ファイル: legacy22_check.php プロジェクト: hiro1173/legacy
/*** check setting of XOOPS_TRUST_PATH ***/
switch (checkMainfile()) {
    case 0:
        $messages[] = 'You must add XOOPS_TRUST_PATH setting in ' . XOOPS_ROOT_PATH . '/mainfile.php';
        break;
    case 1:
        $messages[] = 'Directory XOOPS_TRUST_PATH(' . XOOPS_TRUST_PATH . ') is NOT found.';
        break;
}
/*** check table field expand by preload ***/
if (!checkTable()) {
    $messages[] = 'You must put extras/extra_preload/upgrade22.class.php in ' . XOOPS_ROOT_PATH . '/preload';
}
/*** check latest language file ***/
$lang = XCube_Root::getSingleton()->mLanguageManager->mLanguageName;
if (!checkLanguage($lang)) {
    $messages[] = 'You must move the latest language files from extras/extra_languages/' . $lang . '. DON\'T MOVE /install directory !';
}
/*** check file existing ***/
$files = checkFile();
foreach ($files as $file) {
    $messages[] = $file;
}
/*** check directory existing ***/
$directories = checkDirectory();
foreach ($directories as $dir) {
    $messages[] = $dir;
}
/*** check directory permission to write ***/
$permissions = checkPermission();
foreach ($permissions as $perm) {
コード例 #6
0
ファイル: checkLanguage.php プロジェクト: puring0815/OpenKore
}
# Add duplicate option if specified
if (isset($options['duplicate'])) {
    $wgChecks[] = 'duplicate';
}
# Should check for EXIF?
$wgCheckEXIF = !isset($options['noexif']);
# Get language objects
$wgLanguages = new languages($wgCheckEXIF);
# Get the general messages
$wgGeneralMessages = $wgLanguages->getGeneralMessages();
$wgRequiredMessagesNumber = count($wgGeneralMessages['required']);
# Check the language
if ($wgCode == 'all') {
    foreach ($wgLanguages->getLanguages() as $language) {
        if ($language != 'en' && $language != 'enRTL') {
            checkLanguage($language);
        }
    }
} else {
    # Can't check English
    if ($wgCode == 'en') {
        echo "Current selected language is English, which cannot be checked.\n";
    } else {
        if ($wgCode == 'enRTL') {
            echo "Current selected language is RTL English, which cannot be checked.\n";
        } else {
            checkLanguage($wgCode);
        }
    }
}
コード例 #7
0
/**
 * Returns the name of the language to use
 * preference priority: member - site
 * defaults to english when no good language found
 *
 * checks if file exists, etc...
 */
function getLanguageName()
{
    global $CONF, $member;
    if ($member && $member->isLoggedIn()) {
        // try to use members language
        $memlang = $member->getLanguage();
        if ($memlang != '' && checkLanguage($memlang)) {
            return $memlang;
        }
    }
    // use default language
    if (checkLanguage($CONF['Language'])) {
        return $CONF['Language'];
    } else {
        return 'english';
    }
}
コード例 #8
0
/**
 * @param $filename Filename containing the extension i18n
 * @param $arrayname The name of the array in the filename
 * @param $filter Optional, restrict check to a given language code (default; null)
 */
function checkExtensionLanguage($filename, $arrayname, $filter = null)
{
    global $wgGeneralMessages, $wgRequiredMessagesNumber;
    $extLanguages = new extensionLanguages($filename, $arrayname);
    // Stuff needed by the checkLanguage routine (globals)
    $wgGeneralMessages = $extLanguages->getGeneralMessages();
    $wgRequiredMessagesNumber = count($wgGeneralMessages['required']);
    $langs = $extLanguages->getLanguages();
    if (!$langs) {
        print "ERROR> \${$arrayname} array does not exist.\n";
        return false;
    }
    $nErrors = 0;
    if ($filter) {
        $nErrors += checkLanguage($extLanguages, $filter);
    } else {
        print "Will check " . count($langs) . " languages : " . implode(' ', $langs) . ".\n";
        foreach ($langs as $lang) {
            if ($lang == 'en') {
                #print "Skipped english language\n";
                continue;
            }
            $nErrors += checkLanguage($extLanguages, $lang);
        }
    }
    return $nErrors;
}