Example #1
0
function auth_user($login, $pass)
{
    global $conf;
    global $error;
    if ($login == "" || $pass == "") {
        return false;
    }
    $param = array();
    $param[] = $login;
    $param[] = prepare_string($pass);
    $ret = xmlCall("base.ldapAuth", $param);
    if ($ret != "1") {
        if (!isXMLRPCError()) {
            $error = _("Invalid login");
        }
        return false;
    }
    $subscription = getSubscriptionInformation(true);
    if ($subscription['is_subsscribed']) {
        $msg = array();
        if ($subscription['too_much_users']) {
            $msg[] = _("users");
        }
        if ($subscription['too_much_computers']) {
            $msg[] = _("computers");
        }
        if (count($msg) > 0) {
            $warn = sprintf(_('WARNING: The number of registered %s is exceeding your license.'), implode($msg, _(' and ')));
            new NotifyWidgetWarning($warn);
        }
    }
    return true;
}
Example #2
0
 *
 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require_once "modules/base/includes/users-xmlrpc.inc.php";
require "graph/navbar.inc.php";
require "includes/statusSidebar.inc.php";
$p = new PageGenerator(_("License and support information"));
$p->displayTitle();
$subscription = getSubscriptionInformation(True);
$subscription['product_name'] = implode($subscription['product_name'], _(" and "));
if ($subscription['is_subsscribed']) {
    $warn = array();
    if ($subscription['too_much_users']) {
        $warn[] = _('WARNING: The number of registered users is exceeding your license.');
    }
    if ($subscription['too_much_computers']) {
        $warn[] = _('WARNING: The number of registered computers is exceeding your license.');
    }
    if (count($warn) > 0) {
        $warn[] = _('Please contact your administrator for more information. If you are an administrator, please go to the license status page for more information.');
        print sprintf("<div id=\"alert\">%s</div><br/>", implode($warn, '<br/>'));
    }
}
$labels = array('product_name' => _('Product name'), 'vendor_name' => _('Product vendor'), 'vendor_mail' => _('Product vendor mail'), 'customer_name' => _('Company name'), 'customer_mail' => _('Company administrator mail'), 'comment' => _('Comment'), 'users' => _('Registered users'), 'computers' => _('Registered computers'), 'support_mail' => _('Support mail address'), 'support_phone' => _('Support phone number'), 'support_comment' => _('Comment'));