예제 #1
0
 private function downloads()
 {
     //FIXME: This needs to give an appropriate error message to both Open Source and ASP Free users.
     //       The current message is geared toward Open Source users.
     if (!file_exists('modules/asp') && !LicenseUtility::isProfessional()) {
         CommonErrors::fatal(COMMONERROR_RESTRICTEDEXTENSION, $this);
     }
     // FIXME: Temporary! We need a better error message.
     if ($_SESSION['CATS']->isFree() || $_SESSION['CATS']->isDemo()) {
         CommonErrors::fatal(COMMONERROR_RESTRICTEDEXTENSION, $this);
     }
     // FIXME: 's' isn't a good variable name.
     if (isset($_GET['s'])) {
         switch ($_GET['s']) {
             case 'toolbar':
                 $templateFile = './modules/asp/toolbar.tpl';
                 break;
             default:
                 $templateFile = './modules/settings/AspDownloads.tpl';
                 break;
         }
     } else {
         $templateFile = './modules/settings/AspDownloads.tpl';
     }
     $this->_template->assign('isFree', $_SESSION['CATS']->isFree());
     $this->_template->assign('subActive', 'Extras');
     $this->_template->assign('active', $this);
     $this->_template->display($templateFile);
 }
예제 #2
0
 /**
  * Prints footer HTML for non-report pages.
  *
  * @return void
  */
 public static function printFooter()
 {
     $build = $_SESSION['CATS']->getCachedBuild();
     $loadTime = $_SESSION['CATS']->getExecutionTime();
     if ($build > 0) {
         $buildString = ' build ' . $build;
     } else {
         $buildString = '';
     }
     /* THE MODIFICATION OF THE COPYRIGHT AND 'Powered by CATS' LINES IS NOT ALLOWED
                BY THE TERMS OF THE CPL FOR CATS OPEN SOURCE EDITION.
     
                  II) The following copyright notice must be retained and clearly legible
                  at the bottom of every rendered HTML document: Copyright (C) 2005 - 2007
                  Cognizo Technologies, Inc. All rights reserved.
     
                  III) The "Powered by CATS" text or logo must be retained and clearly
                  legible on every rendered HTML document. The logo, or the text
                  "CATS", must be a hyperlink to the CATS Project website, currently
                  http://www.catsone.com/.
            */
     echo '<div class="footerBlock">', "\n";
     echo '<p id="footerText">CATS Version ', CATS_VERSION, $buildString, '. <span id="toolbarVersion"></span>Powered by <a href="http://www.catsone.com/"><strong>CATS</strong></a>.</p>', "\n";
     echo '<span id="footerResponse">Server Response Time: ', $loadTime, ' seconds.</span><br />';
     echo '<span id="footerCopyright">', COPYRIGHT_HTML, '</span>', "\n";
     if (!eval(Hooks::get('TEMPLATEUTILITY_SHOWPRIVACYPOLICY'))) {
         return;
     }
     echo '</div>', "\n";
     eval(Hooks::get('TEMPLATE_UTILITY_PRINT_FOOTER'));
     echo '</body>', "\n";
     echo '</html>', "\n";
     if ((!file_exists('modules/asp') || defined('CATS_TEST_MODE') && CATS_TEST_MODE) && LicenseUtility::isProfessional() && !rand(0, 10)) {
         if (!LicenseUtility::validateProfessionalKey(LICENSE_KEY)) {
             CATSUtility::changeConfigSetting('LICENSE_KEY', "''");
         }
     }
 }
예제 #3
0
                                        </td>
                                    </tr>
                                <?php endif; ?>
                                <?php if (!$this->license['canAdd'] && !$this->license['unlimited']): ?>
                                    <tr>
                                        <td class="tdVertical">Notice:</td>
                                        <td class="tdData" style="color: #800000;">
                                            <b>You are currently using your full allotment of active user accounts. Disable an existing account or upgrade your license to add another active user.</b>
                                        </td>
                                    </tr>
                                <?php endif; ?>
                            </table>
                        </td>
                        <?php
                        eval(Hooks::get('SETTINGS_USERS_FULLQUOTALICENSES'));
                        if (!$this->license['canAdd'] && !$this->license['unlimited'] && LicenseUtility::isProfessional() && !file_exists('modules/asp'))
                        {
                            echo '<td valign="top" align="center">';
                            $link = 'http://www.catsone.com/professional';
                            $image = 'images/add_licenses.jpg';

                            echo '<a href="' . $link . '">';
                            echo '<img src="' . $image . '" border="0" alt="Click here to add more user licenses"/>';
                            echo '</a>';
                            echo '<div style="text-align: left; padding: 10px 25px 0px 25px;">';
                            echo 'A <i>user license</i>, or <i>seat</i>, is the limit of full-access users you can have. You may ';
                            echo 'have unlimited read only users.';
                            echo '<p>';

                            echo 'This version of CATS is licensed to:<br /><center>';
                            echo '<b>' . LicenseUtility::getName() . '</b><br />';
예제 #4
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;
 }
예제 #5
0
    /**
     * Returns an array of license data
     *
     * @return array
     */
    public function getLicenseData()
    {
        $sql = sprintf(
            "SELECT
                COUNT(user.site_id) AS totalUsers,
                user.access_level,
                site.user_licenses AS userLicenses
            FROM
                user
            LEFT JOIN site
                ON user.site_id = site.site_id
            WHERE
                user.site_id = %s
            AND
                user.access_level > %s
            GROUP BY
                user.site_id",
            $this->_siteID,
            ACCESS_LEVEL_READ
        );
        $license = $this->_db->getAssoc($sql);

        if (empty($license))
        {
            $license['totalUsers'] = 0;
            $license['userLicenses'] = 0;
        }

        $license['diff'] = $license['userLicenses'] - $license['totalUsers'];
        $license['unlimited'] = 0;
        $license['canAdd'] = 0;

        if ($license['userLicenses'] == 0)
        {
            $license['unlimited'] = 1;
            $license['canAdd'] = 1;
        }
        else if ($license['diff'] > 0)
        {
            $license['canAdd'] = 1;
        }

        if (LicenseUtility::isProfessional() && !file_exists('modules/asp'))
        {
            $license['unlimited'] = 0;
            $license['userLicenses'] = LicenseUtility::getNumberOfSeats();
            $license['diff'] = $license['userLicenses'] - $license['totalUsers'];
            if ($license['diff'] > 0)
            {
                $license['canAdd'] = 1;
            }
            else
            {
                $license['canAdd'] = 0;
            }
        }

        return $license;
    }