Beispiel #1
0
 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');
 }
Beispiel #2
0
                        /* catsone.com demo domain doesn't relogin. */
                        if (strpos(CATSUtility::getIndexName(), '://demo.catsone.com') !== false) {
                            CATSUtility::transferURL('http://www.catsone.com');
                        } else {
                            CATSUtility::transferRelativeURI($URI);
                        }
                    } else {
                        if (!ModuleUtility::moduleRequiresAuthentication($_GET['m'])) {
                            /* No authentication required; load the module. */
                            ModuleUtility::loadModule($_GET['m']);
                        } else {
                            if (!$_SESSION['CATS']->isLoggedIn()) {
                                /* User isn't logged in and authentication is required; send the user
                                 * to the login page.
                                 */
                                ModuleUtility::loadModule('login');
                            } else {
                                /* Everything's good; load the requested module. */
                                $_SESSION['CATS']->logPageView();
                                ModuleUtility::loadModule($_GET['m']);
                            }
                        }
                    }
                }
            }
        }
    }
}
if (isset($errorHandler)) {
    $errorHandler->reportErrors();
}
Beispiel #3
0
 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');
 }
Beispiel #4
0
 /**
  * Prints the module tabs.
  *
  * @param UserInterface active module interface
  * @param string active subtab name
  * @param string module name to forcibly highlight
  * @return void
  */
 public static function printTabs($active, $subActive = '', $forceHighlight = '')
 {
     /* Special tab behaviors:
      *
      * Tab text = 'something*al=somenumber' where somenumber is an access level -
      *      Only display tab if current user userlevel >= somenumber.
      *
      * Subtab url = 'url*al=somenumber' where somenumber is an access level -
      *      Only display subtab if current user userlevel >= somenumber.
      *
      * Subtab url = 'url*js=javascript code' where javascript code is JS commands -
      *      JS code to execute for button OnClick event.
      */
     /* FIXME:  There is too much logic going on here, there should be something that loads settings or evaluates what tabs
        shouldn't be drawn. */
     echo '<div id="header">', "\n";
     echo '<ul id="primary">', "\n";
     $indexName = CATSUtility::getIndexName();
     $modules = ModuleUtility::getModules();
     foreach ($modules as $moduleName => $parameters) {
         $tabText = $parameters[1];
         /* Don't display a module's tab if $tabText is empty. */
         if (empty($tabText)) {
             continue;
         }
         /* If name = Companies and HR mode is on, change tab name to My Company. */
         if ($_SESSION['CATS']->isHrMode() && $tabText == 'Companies') {
             $tabText = 'My Company';
         }
         /* Allow a hook to prevent a module from being displayed. */
         $displayTab = true;
         if (!eval(Hooks::get('TEMPLATE_UTILITY_EVALUATE_TAB_VISIBLE'))) {
             return;
         }
         if (!$displayTab) {
             continue;
         }
         /* Inactive Tab? */
         if ($active === null || $moduleName != $active->getModuleName()) {
             if ($moduleName == $forceHighlight) {
                 $className = 'active';
             } else {
                 $className = 'inactive';
             }
             $alPosition = strpos($tabText, "*al=");
             if ($alPosition === false) {
                 echo '<li><a class="', $className, '" href="', $indexName, '?m=', $moduleName, '">', $tabText, '</a></li>', "\n";
             } else {
                 $al = substr($tabText, $alPosition + 4);
                 if ($_SESSION['CATS']->getAccessLevel() >= $al || $_SESSION['CATS']->isDemo()) {
                     echo '<li><a class="', $className, '" href="', $indexName, '?m=', $moduleName, '">', substr($tabText, 0, $alPosition), '</a></li>', "\n";
                 }
             }
             continue;
         }
         $alPosition = strpos($tabText, "*al=");
         if ($alPosition !== false) {
             $tabText = substr($tabText, 0, $alPosition);
         }
         /* Start the <li> block for the active tab. The secondary <ul>
          * for subtabs MUST be contained within this block. It is
          * closed after subtabs are printed. */
         echo '<li>';
         echo '<a class="active" href="', $indexName, '?m=', $moduleName, '">', $tabText, '</a>', "\n";
         $subTabs = $active->getSubTabs($modules);
         if ($subTabs) {
             echo '<ul id="secondary">';
             foreach ($subTabs as $subTabText => $link) {
                 if ($subTabText == $subActive) {
                     $style = "color:#cccccc;";
                 } else {
                     $style = "";
                 }
                 /* Check HR mode for displaying tab. */
                 $hrmodePosition = strpos($link, "*hrmode=");
                 if ($hrmodePosition !== false) {
                     /* Access level restricted subtab. */
                     $hrmode = substr($link, $hrmodePosition + 8);
                     if (!$_SESSION['CATS']->isHrMode() && $hrmode == 0 || $_SESSION['CATS']->isHrMode() && $hrmode == 1) {
                         $link = substr($link, 0, $hrmodePosition);
                     } else {
                         $link = '';
                     }
                 }
                 /* Check access level for displaying tab. */
                 $alPosition = strpos($link, "*al=");
                 if ($alPosition !== false) {
                     /* Access level restricted subtab. */
                     $al = substr($link, $alPosition + 4);
                     if ($_SESSION['CATS']->getAccessLevel() >= $al || $_SESSION['CATS']->isDemo()) {
                         $link = substr($link, 0, $alPosition);
                     } else {
                         $link = '';
                     }
                 }
                 $jsPosition = strpos($link, "*js=");
                 if ($jsPosition !== false) {
                     /* Javascript subtab. */
                     echo '<li><a href="', substr($link, 0, $jsPosition), '" onclick="', substr($link, $jsPosition + 4), '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
                 } else {
                     if (strpos($link, 'a=internalPostings') !== false) {
                         /* Default company subtab. */
                         include_once './lib/Companies.php';
                         $companies = new Companies($_SESSION['CATS']->getSiteID());
                         $defaultCompanyID = $companies->getDefaultCompany();
                         if ($defaultCompanyID !== false) {
                             echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
                         }
                     } else {
                         if (strpos($link, 'a=administration') !== false) {
                             /* Administration subtab. */
                             if ($_SESSION['CATS']->getRealAccessLevel() >= ACCESS_LEVEL_DEMO) {
                                 echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
                             }
                         } else {
                             if (strpos($link, 'a=customizeEEOReport') !== false) {
                                 /* EEO Report subtab.  Shouldn't be visible if EEO tracking is disabled. */
                                 $EEOSettings = new EEOSettings($_SESSION['CATS']->getSiteID());
                                 $EEOSettingsRS = $EEOSettings->getAll();
                                 if ($EEOSettingsRS['enabled'] == 1) {
                                     echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
                                 }
                             } else {
                                 if ($link != '') {
                                     /* Normal subtab. */
                                     echo '<li><a href="', $link, '" style="' . $style . '">', $subTabText, '</a></li>', "\n";
                                 }
                             }
                         }
                     }
                 }
             }
             if (!eval(Hooks::get('TEMPLATE_UTILITY_DRAW_SUBTABS'))) {
                 return;
             }
             echo '</ul>';
         }
         echo '</li>';
     }
     echo '</ul>', "\n";
     echo '</div>', "\n";
 }
Beispiel #5
0
    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');
            }
        }
    }
Beispiel #6
0
@session_name(CATS_SESSION_NAME);
session_start();
/* Make sure we aren't getting screwed over by magic quotes. */
if (get_magic_quotes_runtime()) {
    set_magic_quotes_runtime(0);
}
if (get_magic_quotes_gpc()) {
    $_GET = array_map('stripslashes', $_GET);
    $_POST = array_map('stripslashes', $_POST);
    $_REQUEST = array_map('stripslashes', $_REQUEST);
}
if (!isset($_SESSION['CATS']) || empty($_SESSION['CATS'])) {
    $_SESSION['CATS'] = new CATSSession();
}
// Register module specific tasks
$taskedModules = ModuleUtility::registerModuleTasks();
print_r($taskedModules);
// Execute the next appropriate (if available) queue and return a status code
$retVal = QueueProcessor::startNextTask();
// Mark the queue processor last-run time
touch(QUEUE_STATUS_FILE);
if (file_exists(QUEUE_CLEANUP_FILE)) {
    $lastCleanupTime = @filemtime(QUEUE_CLEANUP_FILE);
} else {
    $lastCleanupTime = 0;
}
if (time() - $lastCleanupTime > QUEUE_CLEANUP_HOURS * 60 * 60 || !$lastCleanupTime) {
    @touch(QUEUE_CLEANUP_FILE);
    QueueProcessor::cleanUpErroredTasks();
    QueueProcessor::cleanUpOldQueues();
}
Beispiel #7
0
 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;
 }
 * 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;
Beispiel #9
0
                                    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>
Beispiel #10
0
                                CATSUtility::transferURL('http://www.catsone.com');
                            } else {
                                CATSUtility::transferRelativeURI($URI);
                            }
                        } else {
                            if (!ModuleUtility::moduleRequiresAuthentication($_REQUEST['m'])) {
                                /* No authentication required; load the module. */
                                ModuleUtility::loadModule($_REQUEST['m']);
                            } else {
                                if (!$_SESSION['CATS']->isLoggedIn()) {
                                    /* User isn't logged in and authentication is required; send the user
                                     * to the login page.
                                     */
                                    ModuleUtility::loadModule('login');
                                } else {
                                    /* Everything's good; load the requested module. */
                                    $_SESSION['CATS']->logPageView();
                                    ModuleUtility::loadModule($_REQUEST['m']);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
if (isset($errorHandler)) {
    $errorHandler->reportErrors();
}
Logger::getLogger("AuieoATS")->info("End....");
Beispiel #11
0
    private function loadTheme($_AUIEO_ARR_THEME_VAR)
    {
        if($_SERVER["REQUEST_URI"]=="/demo/careers/")
        {
            $AUIEO_THEME_MODULE="careers";
        }
        else if(isset($_REQUEST["m"]) && $_REQUEST["m"]=="careers")
        {
            $AUIEO_THEME_MODULE="careers";
        }
        else if(!$_SESSION['CATS']->isLoggedIn())
        {
            $AUIEO_THEME_MODULE="login";
        }
        else
        {
            $AUIEO_THEME_MODULE=isset($_REQUEST["m"])?$_REQUEST["m"]:"index";
        }
        
        $objModule=new ClsAuieoModule($AUIEO_THEME_MODULE,isset($_REQUEST["a"])?$_REQUEST["a"]:"create");
        $actionTheme=$objModule->getConfigVar("actions");
        if($actionTheme)
        {
            $AUIEO_THEME_MODULE=$actionTheme;
        }
        if(!file_exists("themes/default/{$AUIEO_THEME_MODULE}.php"))
        {
            $AUIEO_THEME_MODULE="index";
        }
        extract($_AUIEO_ARR_THEME_VAR);
        unset($_AUIEO_ARR_THEME_VAR);
        
        $HTML_ENCODING=HTML_ENCODING;
        
        $AUIEO_USER_NAME     = $_SESSION['CATS']->getUsername();
        $AUIEO_SITE_NAME     = $_SESSION['CATS']->getSiteName();
        $AUIEO_FULL_NAME     = $_SESSION['CATS']->getFullName();
        $AUIEO_INDEX_NAME    = CATSUtility::getIndexName();
        
        $_AUIEO_MODULE=isset($_GET["m"])?$_GET["m"]:"home";
        
        if (strpos($AUIEO_USER_NAME, '@'.$_SESSION['CATS']->getSiteID()) !== false &&
            substr($AUIEO_USER_NAME, strpos($username, '@'.$_SESSION['CATS']->getSiteID())) ==
            '@'.$_SESSION['CATS']->getSiteID() )
        {
           $AUIEO_USER_NAME = str_replace('@'.$_SESSION['CATS']->getSiteID(), '', $AUIEO_USER_NAME);
        }

        $ACCESS_LEVEL_SA_GREATER="";
        if ($_SESSION['CATS']->getAccessLevel() >= ACCESS_LEVEL_SA)
        {
            $ACCESS_LEVEL_SA_GREATER = "&nbsp;<span style='font-weight:bold;'>Administrator</span>\n";
        }

        $AUIEO_NOTICE="";
        /* Disabled notice */
        if (!$_SESSION['CATS']->accountActive())
        {
            $AUIEO_NOTICE = "<span style='font-weight:bold;'>Account Inactive</span><br />\n";
        }
        else if ($_SESSION['CATS']->getAccessLevel() == ACCESS_LEVEL_READ)
        {
            $AUIEO_NOTICE = "<span>Read Only Access</span><br />\n";
        }
        
        ob_start();
        $forceHighlight = '';

        $modules = ModuleUtility::getModules();
        if($_SESSION["CATS"]->getSiteID()>0)
        {
            $objPRGManagement=PRGManagement::getInstance();
        }
        foreach ($modules as $moduleName => $parameters)
        {
            if($_SESSION["CATS"]->getSiteID()>0)
            {
                $permit=$objPRGManagement->isModulePermitted($moduleName);
                if($permit===false)
                {
                    continue;
                }
            }
           $tabText = $parameters[1];

           /* Don't display a module's tab if $tabText is empty. */
           if (empty($tabText))
           {
               continue;
           }

           /* If name = Companies and HR mode is on, change tab name to My Company. */
           if ($_SESSION['CATS']->isHrMode() && $tabText == 'Companies')
           {
               $tabText = 'My Company';
           }

           /* Allow a hook to prevent a module from being displayed. */
           $displayTab = true;

           if (!eval(Hooks::get('TEMPLATE_UTILITY_EVALUATE_TAB_VISIBLE'))) return;

           if (!$displayTab)
           {
               continue;
           }

           /* Inactive Tab? */
           if (!isset($this->active) || empty($this->active) || $moduleName != $this->active->getModuleName())
           {
               if ($moduleName == $forceHighlight)
               {
                   $className = 'active';
               }
               else
               {
                   $className = 'inactive';
               }

               $alPosition = strpos($tabText, "*al=");
               if ($alPosition === false)
               {
                   echo '<li><a class="', $className, '" href="', $AUIEO_INDEX_NAME,
                        '?m=', $moduleName, '">', $tabText, '</a></li>', "\n";
               }
               else
               {
                    $al = substr($tabText, $alPosition + 4);
                    if ($_SESSION['CATS']->getAccessLevel() >= $al ||
                        $_SESSION['CATS']->isDemo())
                    {
                       echo '<li><a class="', $className, '" href="', $indexName, '?m=', $moduleName, '">',
                            substr($tabText, 0, $alPosition), '</a></li>', "\n";
                   }
               }

               continue;
           }

           $alPosition = strpos($tabText, "*al=");
           if ($alPosition !== false)
           {
               $tabText = substr($tabText, 0, $alPosition);
           }

           /* Start the <li> block for the active tab. The secondary <ul>
            * for subtabs MUST be contained within this block. It is
            * closed after subtabs are printed. */
           echo '<li>';

           echo '<a class="active" href="', $AUIEO_INDEX_NAME, '?m=', $moduleName,
                '">', $tabText, '</a>', "\n";

           $subTabs = $this->active->getSubTabs($modules);
           if ($subTabs)
           {
               echo '<ul id="secondary">';

               foreach ($subTabs as $subTabText => $link)
               {
                   if (isset($this->subActive) && $subTabText == $this->subActive)
                   {
                       $style = "color:#cccccc;";
                   }
                   else
                   {
                       $style = "";
                   }

                   /* Check HR mode for displaying tab. */
                   $hrmodePosition = strpos($link, "*hrmode=");
                   if ($hrmodePosition !== false)
                   {
                       /* Access level restricted subtab. */
                       $hrmode = substr($link, $hrmodePosition + 8);
                       if ((!$_SESSION['CATS']->isHrMode() && $hrmode == 0) ||
                           ($_SESSION['CATS']->isHrMode() && $hrmode == 1))
                       {
                           $link =  substr($link, 0, $hrmodePosition);
                       }
                       else
                       {
                           $link = '';
                       }
                   }

                   /* Check access level for displaying tab. */
                   $alPosition = strpos($link, "*al=");
                   if ($alPosition !== false)
                   {
                       /* Access level restricted subtab. */
                       $al = substr($link, $alPosition + 4);
                       if ($_SESSION['CATS']->getAccessLevel() >= $al ||
                           $_SESSION['CATS']->isDemo())
                       {
                           $link =  substr($link, 0, $alPosition);
                       }
                       else
                       {
                           $link = '';
                       }
                   }

                   $jsPosition = strpos($link, "*js=");
                   if ($jsPosition !== false)
                   {
                       /* Javascript subtab. */
                       echo '<li><a href="', substr($link, 0, $jsPosition), '" onclick="',
                            substr($link, $jsPosition + 4), '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
                   }

                   /* A few subtabs have special logic to decide if they display or not. */
                   /* FIXME:  Put the logic for these somewhere else.  Perhaps the definitions of the subtabs
                              themselves should have an eval()uatable rule?
                              Brian 6-14-07:  Second.  */
                   else if (strpos($link, 'a=internalPostings') !== false)
                   {
                       /* Default company subtab. */
                       include_once('./lib/Companies.php');

                       $companies = new Companies($_SESSION['CATS']->getSiteID());
                       $defaultCompanyID = $companies->getDefaultCompany();
                       if ($defaultCompanyID !== false)
                       {
                           echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
                       }
                   }
                   else if (strpos($link, 'a=administration') !== false)
                   {
                       /* Administration subtab. */
                       if ($_SESSION['CATS']->getRealAccessLevel() >= ACCESS_LEVEL_DEMO)
                       {
                           echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
                       }
                   }
                   else if (strpos($link, 'a=customizeEEOReport') !== false)
                   {
                       /* EEO Report subtab.  Shouldn't be visible if EEO tracking is disabled. */
                       $EEOSettings = new EEOSettings($_SESSION['CATS']->getSiteID());
                       $EEOSettingsRS = $EEOSettings->getAll();

                       if ($EEOSettingsRS['enabled'] == 1)
                       {
                           echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
                       }
                   }


                   /* Tab is ok to draw. */
                   else if ($link != '')
                   {
                       /* Normal subtab. */
                       echo '<li><a href="', $link, '" style="'.$style.'">', $subTabText, '</a></li>', "\n";
                   }
               }

               if (!eval(Hooks::get('TEMPLATE_UTILITY_DRAW_SUBTABS'))) return;

               echo '</ul>';
           }

           echo '</li>';
        }

        $_AUIEO_TABS=  ob_get_clean();

        $systemInfo = new SystemInfo();
        $systemInfoData = $systemInfo->getSystemInfo();
        $AUIEO_DOWNLOAD_LATEST="";
        if (isset($systemInfoData['available_version']) &&
            $systemInfoData['available_version'] > CATSUtility::getVersionAsInteger() &&
            isset($systemInfoData['disable_version_check']) &&
            !$systemInfoData['disable_version_check'] &&
            $_SESSION['CATS']->getAccessLevel() >= ACCESS_LEVEL_SA)
        {
            $AUIEO_DOWNLOAD_LATEST = "<a href='http://www.catsone.com/download.php' target='catsdl'>A new CATS version is available!</a><br />";
        }
        $AUIEO_RECENT="";
        if (!empty($MRU))
        {
            $AUIEO_RECENT = '<span class="MRUTitle">Recent:&nbsp;</span>&nbsp;{$MRU}';
        }
        else
        {
            $AUIEO_RECENT = '<span class="MRUTitle"></span>&nbsp;';
        }
        $AUIEO_HAS_USER_CATEGORY="";
        //FIXME:  Abstract into a hook.
        if ($_SESSION['CATS']->hasUserCategory('msa'))
        {
            $AUIEO_HAS_USER_CATEGORY = "<input type='hidden' name='m' value='asp' />
                <input type='hidden' name='a' value='aspSearch' />
                <span class='quickSearchLabel' id='quickSearchLabel>ASP Search:</span>&nbsp;";
        }
        else
        {
            $AUIEO_HAS_USER_CATEGORY = "<input type='hidden' name='m' value='home' />
                <input type='hidden' name='a' value='quickSearch' />
                <span class='quickSearchLabel' id='quickSearchLabel'>Quick Search:</span>&nbsp;";
        }


        $wildCardString = '';
        /* Get the formatted MRU list from Session. */
                $MRU = $_SESSION['CATS']->getMRU()->getFormatted();
                $indexName = CATSUtility::getIndexName();
        
        $AUIEO_PREFIX="";
        if(isset($_REQUEST["m"]) && $_REQUEST["m"]=="careers")
        {
            $AUIEO_PREFIX="../";
        }
        
        $pageTitle = pageTitle();
        $headIncludes = pageHeaderInclude();
        $AUIEO_PAGE_START="";
        ob_start();
        //TemplateUtility::_printCommonHeader($pageTitle, $headIncludes);

        if (!is_array($headIncludes))
        {
            $headIncludes = array($headIncludes);
        }

        $siteID = $_SESSION['CATS']->getSiteID();

        /* This prevents caching problems when SVN updates are preformed. */
        if ($_SESSION['CATS']->getCachedBuild() > 0)
        {
            $javascriptAntiCache = '?b=' . $_SESSION['CATS']->getCachedBuild();
        }
        else
        {
            $javascriptAntiCache = '?v=' . CATSUtility::getVersionAsInteger();
        }

        $headIncludes[] = 'main.css';

        foreach ($headIncludes as $key => $filename)
        {
            /* Done manually to prevent a global dependency on FileUtility. */
            if ($filename == 'tinymce')
            {
                echo ('<script language="javascript" type="text/javascript" src="lib/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>'."\n".
                      '<script language="javascript" type="text/javascript">tinyMCE.init({
                            mode : "specific_textareas",
                            editor_selector : "mceEditor",
                            width : "100%",
                                theme : "advanced",
                                theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,separator,underline,forecolor,separator,removeformat,cleanup,separator,charmap,separator,undo,redo",
                                theme_advanced_buttons2 : "",
                                theme_advanced_buttons3 : "",
                                language : "en",
                                theme_advanced_toolbar_location : "top",
                                theme_advanced_toolbar_align : "left",
                                theme_advanced_resizing : true,
                                browsers : "msie,gecko,opera,safari",
                                dialog_type : "modal",
                                theme_advanced_resize_horizontal : false,
                                convert_urls : false,
                                relative_urls : false,
                                remove_script_host : false,
                                force_p_newlines : false,
                                force_br_newlines : true,
                                convert_newlines_to_brs : false,
                                remove_linebreaks : false,
                                fix_list_elements : true
                        });</script>'."\n");
            }
            else
            {

                $extension = substr($filename, strrpos($filename, '.') + 1);

                $filename .= $javascriptAntiCache;

                if ($extension == 'js')
                {
                    echo '<script type="text/javascript" src="', $filename, '"></script>', "\n";
                }
                else if ($extension == 'css')
                {
                    echo '<style type="text/css" media="all">@import "', $filename, '";</style>', "\n";
                }
            }
        }


        $AUIEO_PAGE_START=  ob_get_clean();

        //ob_start();
        $AUIEO_LOAD_TIME = $_SESSION['CATS']->getExecutionTime();

        $AUIEO_CANDIDATS_VERSION=CANDIDATS_VERSION;
        
        include("themes/default/{$AUIEO_THEME_MODULE}.php");
        /**
        * for handing comment in html template. usage is {$_("This is comment")}
        */
       $_=function($comment)
       {
           return "";
       };
        ob_start();
        eval('echo <<< EOT
        '.file_get_contents("themes/default/{$AUIEO_THEME_MODULE}.html").'
EOT;
');
        $html = ob_get_clean();
        return $html;
    }