コード例 #1
0
ファイル: SettingsUI.php プロジェクト: rankinp/OpenCATS
 private function manageProfessional()
 {
     /* Bail out if the user doesn't have SA permissions. */
     if ($this->_realAccessLevel < ACCESS_LEVEL_DEMO) {
         CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
     }
     if (ModuleUtility::moduleExists('asp') && (!defined('CATS_TEST_MODE') || !CATS_TEST_MODE)) {
         CommonErrors::fatal(COMMONERROR_PERMISSION, $this);
     }
     $wf = new WebForm();
     $wf->addField('licenseKey', 'License Key', WFT_TEXT, true, 60, 30, 190, '', '/[A-Za-z0-9 ]+/', 'That is not a valid license key!');
     $message = '';
     $license = new License();
     $upgradeStatus = false;
     if (isset($_GET['webFormPostBack'])) {
         list($fields, $errors) = $wf->getValidatedFields();
         if (count($errors) > 0) {
             $message = 'Please enter a license key in order to continue.';
         }
         $key = trim($fields['licenseKey']);
         $configWritten = false;
         if ($license->setKey($key) === false) {
             $message = 'That is not a valid license key<br /><span style="font-size: 16px; color: #000000;">Please verify that you have the correct key and try again.</span>';
         } else {
             if ($license->isProfessional()) {
                 if (!CATSUtility::isSOAPEnabled()) {
                     $message = 'CATS Professional requires the PHP SOAP library which isn\'t currently installed.<br /><br />' . 'Installation Instructions:<br /><br />' . 'WAMP/Windows Users:<dl>' . '<li>Left click on the wamp icon.</li>' . '<li>Select "PHP Settings" from the drop-down list.</li>' . '<li>Select "PHP Extensions" from the drop-down list.</li>' . '<li>Check the "php_soap" option.</li>' . '<li>Restart WAMP.</li></dl>' . 'Linux Users:<br /><br />' . 'Re-install PHP with the --enable-soap configuration option.<br /><br />' . 'Please visit http://www.catsone.com for more support options.';
                 }
                 if (!LicenseUtility::validateProfessionalKey($key)) {
                     $message = 'That is not a valid Professional membership key<br /><span style="font-size: 16px; color: #000000;">Please verify that you have the correct key and try again.</span>';
                 } else {
                     if (!CATSUtility::changeConfigSetting('LICENSE_KEY', "'" . $key . "'")) {
                         $message = 'Internal Permissions Error<br /><span style="font-size: 12px; color: #000000;">CATS is unable ' . 'to write changes to your <b>config.php</b> file. Please change the file permissions or contact us ' . 'for support. Our support e-mail is <a href="mailto:support@catsone.com">support@catsone.com</a> ' . 'and our office number if (952) 417-0067.</span>';
                     } else {
                         $upgradeStatus = true;
                     }
                 }
             } else {
                 $message = 'That is not a valid Professional membership key<br /><span style="font-size: 16px; color: #000000;">Please verify that you have the correct key and try again.</span>';
             }
         }
     }
     $this->_template->assign('active', $this);
     $this->_template->assign('subActive', 'Professional Membership');
     $this->_template->assign('message', $message);
     $this->_template->assign('upgradeStatus', $upgradeStatus);
     $this->_template->assign('webForm', $wf);
     $this->_template->assign('license', $license);
     $this->_template->display('./modules/settings/Professional.tpl');
 }
コード例 #2
0
ファイル: index.php プロジェクト: HTApplications/OpenCATS
}
/* Make sure we have a Session object stored in the user's session. */
if (!isset($_SESSION['CATS']) || empty($_SESSION['CATS'])) {
    $_SESSION['CATS'] = new CATSSession();
}
/* Start timer for measuring server response time. Displayed in footer. */
$_SESSION['CATS']->startTimer();
/* Check to see if the server went through a SVN update while the session
 * was active.
 */
$_SESSION['CATS']->checkForcedUpdate();
/* We would hook this, but the hooks aren't loaded by the time this code executes.
 * if ASP module exists (code is running on catsone.com), load the website by default
 * rather than the login page.
 */
if (ModuleUtility::moduleExists("asp") && ModuleUtility::moduleExists("website")) {
    // FIXME: Can we optimize this a bit...?
    include_once 'modules/asp/lib/General.php';
    if (!(isset($careerPage) && $careerPage) && !(isset($rssPage) && $rssPage) && !(isset($xmlPage) && $xmlPage) && (!isset($_GET['m']) || empty($_GET['m'])) && (Asp::getSubDomain() == '' || isset($_GET['a']))) {
        ModuleUtility::loadModule('website');
        exit(1);
    }
}
/* Check to see if the user level suddenly changed. If the user was changed to disabled,
 * also log the user out.
 */
// FIXME: This is slow!
if ($_SESSION['CATS']->isLoggedIn()) {
    $users = new Users($_SESSION['CATS']->getSiteID());
    $forceLogoutData = $users->getForceLogoutData($_SESSION['CATS']->getUserID());
    if (!empty($forceLogoutData) && ($forceLogoutData['forceLogout'] == 1 || $_SESSION['CATS']->getRealAccessLevel() != $forceLogoutData['accessLevel'])) {
コード例 #3
0
ファイル: ImportUI.php プロジェクト: PublicityPort/OpenCATS
 function showMassImport()
 {
     $directoryRoot = './upload/';
     if (ModuleUtility::moduleExists('asp')) {
         $siteID = $_SESSION['CATS']->getSiteID();
         $directoryRoot = './upload/' . $siteID . '/';
         if (!file_exists($directoryRoot)) {
             mkdir($directoryRoot, 0777, true);
         }
     }
     $foundFiles = array();
     $numberOfFiles = 0;
     $directoriesToWalk = array('');
     while (count($directoriesToWalk) != 0) {
         $directoryName = array_pop($directoriesToWalk);
         $fullDirectoryName = $directoryRoot . $directoryName;
         if ($handle = @opendir($fullDirectoryName)) {
             while (false !== ($file = readdir($handle))) {
                 $fileWithDirectory = $directoryName . $file;
                 $fullFileWithDirectory = $fullDirectoryName . $file;
                 if ($file != "." && $file != ".." && $file != ".svn" && filetype($fullFileWithDirectory) == "dir") {
                     array_push($directoriesToWalk, $fileWithDirectory . '/');
                 } else {
                     if ($file != "." && $file != ".." && $file != ".svn") {
                         $numberOfFiles++;
                         $foundFiles[] = $directoryName . $file;
                     }
                 }
             }
             closedir($handle);
         }
     }
     sort($foundFiles);
     $_SESSION['CATS']->massImportFiles = $foundFiles;
     $_SESSION['CATS']->massImportDirectory = $directoryRoot;
     $this->_template->assign('active', $this);
     $this->_template->assign('foundFiles', $foundFiles);
     $this->_template->display('./modules/import/ImportResumesBulk.tpl');
 }
コード例 #4
0
ファイル: LoginUI.php プロジェクト: PublicityPort/OpenCATS
    private function attemptLogin()
    {
        //FIXME: getTrimmedInput()!
        if (isset($_POST['siteName'])) {
            $siteName = $_POST['siteName'];
        } else {
            $siteName = '';
        }
        if (!isset($_POST['username']) || !isset($_POST['password'])) {
            $message = 'Invalid username or password.';
            if (isset($_GET['reloginVars'])) {
                $this->_template->assign('reloginVars', urlencode($_GET['reloginVars']));
            } else {
                $this->_template->assign('reloginVars', '');
            }
            $site = new Site(-1);
            $rs = $site->getSiteByUnixName($siteName);
            if (isset($rs['name'])) {
                $siteNameFull = $rs['name'];
            } else {
                $siteNameFull = $siteName;
            }
            $this->_template->assign('aspMode', false);
            if (!eval(Hooks::get('LOGIN_NO_CREDENTIALS'))) {
                return;
            }
            $this->_template->assign('message', $message);
            $this->_template->assign('messageSuccess', false);
            $this->_template->assign('siteName', $siteName);
            $this->_template->assign('siteNameFull', $siteNameFull);
            $this->_template->assign('dateString', date('l, F jS, Y'));
            if (ModuleUtility::moduleExists("asp")) {
                $this->_template->display('./modules/asp/AspLogin.tpl');
            } else {
                $this->_template->display('./modules/login/Login.tpl');
            }
            return;
        }
        $username = $this->getTrimmedInput('username', $_POST);
        $password = $this->getTrimmedInput('password', $_POST);
        if (strpos($username, '@') !== false) {
            $siteName = '';
        }
        if ($siteName != '') {
            $site = new Site(-1);
            $rs = $site->getSiteByUnixName($siteName);
            if (isset($rs['siteID'])) {
                $username .= '@' . $rs['siteID'];
            }
        }
        /* Make a blind attempt at logging the user in. */
        $_SESSION['CATS']->processLogin($username, $password);
        /* If unsuccessful, take the user back to the login page. */
        if (!$_SESSION['CATS']->isLoggedIn()) {
            $message = $_SESSION['CATS']->getLoginError();
            if (isset($_GET['reloginVars'])) {
                $this->_template->assign('reloginVars', urlencode($_GET['reloginVars']));
            } else {
                $this->_template->assign('reloginVars', '');
            }
            $site = new Site(-1);
            $rs = $site->getSiteByUnixName($siteName);
            if (isset($rs['name'])) {
                $siteNameFull = $rs['name'];
            } else {
                $siteNameFull = $siteName;
            }
            $this->_template->assign('aspMode', false);
            if (!eval(Hooks::get('LOGIN_UNSUCCESSFUL'))) {
                return;
            }
            $this->_template->assign('message', $message);
            $this->_template->assign('messageSuccess', false);
            $this->_template->assign('siteName', $siteName);
            $this->_template->assign('siteNameFull', $siteNameFull);
            $this->_template->assign('dateString', date('l, F jS, Y'));
            if (ModuleUtility::moduleExists("asp")) {
                $this->_template->display('./modules/asp/AspLogin.tpl');
            } else {
                $this->_template->display('./modules/login/Login.tpl');
            }
            return;
        }
        $systemInfoDb = new SystemInfo();
        $accessLevel = $_SESSION['CATS']->getAccessLevel();
        $mailerSettings = new MailerSettings($_SESSION['CATS']->getSiteID());
        $mailerSettingsRS = $mailerSettings->getAll();
        /***************************** BEGIN NEW WIZARD *****************************************/
        /**
         * Improved setup wizard using the Wizard library. If the user succeeds,
         * all old-style wizards will no longer be shown.
         */
        $wizard = new Wizard(CATSUtility::getIndexName() . '?m=home', './js/wizardIntro.js');
        if ($_SESSION['CATS']->isFirstTimeSetup()) {
            $wizard->addPage('Welcome!', './modules/login/wizard/Intro.tpl', '', false, true);
        }
        if (!$_SESSION['CATS']->isAgreedToLicense()) {
            $phpeval = '';
            if (!eval(Hooks::get('LICENSE_TERMS'))) {
                return;
            }
            $wizard->addPage('License', './modules/login/wizard/License.tpl', $phpeval, true, true);
        }
        if (!file_exists('modules/asp') || defined('CATS_TEST_MODE') && CATS_TEST_MODE) {
            // On-site wizard pages
            if (!LicenseUtility::isLicenseValid()) {
                if (defined('LICENSE_KEY') && LICENSE_KEY == '') {
                    $template = 'Register.tpl';
                    $templateName = 'Register';
                } else {
                    $template = 'Reregister.tpl';
                    $templateName = 'License Expired';
                }
                $wizard->addPage($templateName, './modules/login/wizard/' . $template, '', false, true);
            }
        }
        // if logged in for the first time, change password
        if (strtolower($username) == 'admin' && $password === DEFAULT_ADMIN_PASSWORD) {
            $wizard->addPage('Password', './modules/login/wizard/Password.tpl', '', false, true);
        }
        // make user set an e-mail address
        if (trim($_SESSION['CATS']->getEmail()) == '') {
            $wizard->addPage('E-mail', './modules/login/wizard/Email.tpl', '', false, true);
        }
        // if no site name set, make user set site name
        if ($accessLevel >= ACCESS_LEVEL_SA && $_SESSION['CATS']->getSiteName() === 'default_site') {
            $wizard->addPage('Site', './modules/login/wizard/SiteName.tpl', '', false, true);
        }
        // CATS Hosted Wizard Pages
        if (!eval(Hooks::get('ASP_WIZARD_PAGES'))) {
            return;
        }
        if ($_SESSION['CATS']->isFirstTimeSetup()) {
            $wizard->addPage('Setup Users', './modules/login/wizard/Users.tpl', '
                $users = new Users($siteID);
                $mp = $users->getAll();
                $data = $users->getLicenseData();

                $this->_template->assign(\'users\', $mp);
                $this->_template->assign(\'totalUsers\', $data[\'totalUsers\']);
                $this->_template->assign(\'userLicenses\', $data[\'userLicenses\']);
                $this->_template->assign(\'accessLevels\', $users->getAccessLevels());
            ');
            if (!eval(Hooks::get('ASP_WIZARD_IMPORT'))) {
                return;
            }
        }
        // The wizard will not display if no pages have been added.
        $wizard->doModal();
        /******************************* END NEW WIZARD *******************************************/
        /* Session is logged in, do we need to send the user to the wizard?
         * This should be done only on the first use, indicated by the
         * admin user's password still being set to the default.
         */
        /* If we have a specific page to go to, go there. */
        /* These hooks are for important things, like disabling the site based on criteria. */
        if (!eval(Hooks::get('LOGGED_IN'))) {
            return;
        }
        if (isset($_GET['reloginVars'])) {
            CATSUtility::transferRelativeURI($_GET['reloginVars']);
        }
        /* LOGGED_IN_MESSAGES hooks are only for messages which show up on initial login (warnings, etc) */
        if (!eval(Hooks::get('LOGGED_IN_MESSAGES'))) {
            return;
        } else {
            if ($accessLevel >= ACCESS_LEVEL_SA && $mailerSettingsRS['configured'] == '0') {
                NewVersionCheck::checkForUpdate();
                $this->_template->assign('inputType', 'conclusion');
                $this->_template->assign('title', 'E-Mail Disabled');
                $this->_template->assign('prompt', 'E-mail features are disabled. In order to enable e-mail features (such as e-mail notifications), please configure your e-mail settings by clicking on the Settings tab and then clicking on Administration.');
                $this->_template->assign('action', $this->getAction());
                $this->_template->assign('home', 'home');
                $this->_template->display('./modules/settings/NewInstallWizard.tpl');
            } else {
                if (!eval(Hooks::get('LOGGED_IN_HOME_PAGE'))) {
                    return;
                }
                CATSUtility::transferRelativeURI('m=home');
            }
        }
    }
コード例 #5
0
ファイル: ToolbarUI.php プロジェクト: PublicityPort/OpenCATS
 private function _authenticate()
 {
     /* Get username / password, and apply ASP username if applicable. */
     $siteID = 1;
     $siteName = '';
     $username = $this->getTrimmedInput('CATSUser', $_GET);
     $password = $this->getTrimmedInput('CATSPassword', $_GET);
     if (!eval(Hooks::get('TOOLBAR_AUTHENTICATE_PRE'))) {
         return;
     }
     if (!$_SESSION['CATS']->isLoggedIn()) {
         $_SESSION['CATS']->processLogin($username, $password);
     }
     if (!eval(Hooks::get('TOOLBAR_AUTHENTICATE_POST'))) {
         return;
     }
     if (!$_SESSION['CATS']->isLoggedIn()) {
         //echo 'cats_authenticationFailed(); Message:You do not have permision to use the toolbar.';
         echo 'cats_authenticationFailed(); Message:' . $_SESSION['CATS']->getLoginError();
         die;
     }
     if (!ModuleUtility::moduleExists('asp')) {
         if (!LicenseUtility::isProfessional()) {
             echo 'cats_authenticationFailed(); Message:The FireFox toolbar extension ' . 'is only available to CATS Professional users. See catsone.com/Professional for ' . 'more information.';
             die;
         }
     }
     return true;
 }
コード例 #6
0
 * Portions created by the Initial Developer are Copyright (C) 2005 - 2007
 * (or from the year in which this file was created to the year 2007) by
 * Cognizo Technologies, Inc. All Rights Reserved.
 *
 */
include_once './config.php';
include_once './lib/DatabaseConnection.php';
include_once './lib/ModuleUtility.php';
if (file_exists('INSTALL_BLOCK')) {
    $interface = new SecureAJAXInterface();
}
set_time_limit(0);
@ini_set('memory_limit', '256M');
$reindexed = 0;
include_once 'lib/Attachments.php';
if (file_exists('INSTALL_BLOCK') && ($_SESSION['CATS']->getAccessLevel() < ACCESS_LEVEL_SA || ModuleUtility::moduleExists('asp'))) {
    die('No permision.');
}
$db = DatabaseConnection::getInstance();
$rs = $db->getAllAssoc('SELECT site_id, attachment_id, directory_name, stored_filename FROM attachment WHERE text = "" OR isnull(text) AND resume = 1');
foreach ($rs as $index => $data) {
    /* Attempt to reindex file. */
    $storedFilename = './attachments/' . $data['directory_name'] . '/' . $data['stored_filename'];
    $documentToText = new DocumentToText();
    $documentType = $documentToText->getDocumentType($storedFilename);
    $fileContents = @file_get_contents($storedFilename);
    /* If we're creating a file from text contents, we can skip
     * extracting because we already know the text contents.
     */
    if ($fileContents !== false && $documentType == DOCUMENT_TYPE_TEXT) {
        $extractedText = $fileContents;
コード例 #7
0
ファイル: AspDownloads.php プロジェクト: Hassanj343/candidats
                                    var isFirefox = false;

                                    /* Browser Detection */
                                    if(navigator.userAgent.indexOf("Firefox")!=-1) {
                                        var versionindex=navigator.userAgent.indexOf("Firefox")+8
                                        if (parseInt(navigator.userAgent.charAt(versionindex))>=1) {
                                           isFirefox = true;
                                        }
                                    }

                                    if (!isFirefox) {
                                        showPopWin('<?php echo(CATSUtility::getIndexName()); ?>?m=settings&a=getFirefoxModal', 400, 270, null); return false;
                                    }
                                    else {
                                        xpi = new Object();
                                        <?php if(ModuleUtility::moduleExists('asp') && false): ?>
                                                                                                    <?php /* TODO:  Toolbar generated automatically with username and password. */ ?>
                                            xpi["CATS ToolBar"] = "http://www.catsone.com/extensions/firefox/catstoolbargenerator.php?" +
                                                "username=<?php echo(urlencode($_SESSION['CATS']->getUsername())); ?>&" +
                                                "password="******"<?php echo(str_rot13(urlencode($_SESSION['CATS']->getPassword()))); ?>")+"&" +
                                                "url=<?php echo(urlencode('https://'.$_SESSION['CATS']->getUnixName())); ?>.catsone.com/";
                                        <?php else: ?>
                                            xpi["CATS ToolBar"] = "http://www.catsone.com/extensions/firefox/catstoolbar.xpi";
                                        <?php endif; ?>
                                        InstallTrigger.install(xpi);
                                        if (typeof sendNotificationEmail == 'function') sendNotificationEmail();
                                    }
                                }
                            <?php endif; ?>
                        </script>
                    </td>