<form name="form_auth" method="post" target="_top" action="/auth.php?login=yes">
<input type="hidden" name="AUTH_FORM" value="Y" />
<input type="hidden" name="TYPE" value="AUTH" />
<?if (strlen($arResult["BACKURL"]) > 0):?>
<input type="hidden" name="backurl" value="<?=$arResult["BACKURL"]?>" />
<?endif?>
<?
foreach ($arResult["POST"] as $key => $value)
{
?>
<input type="hidden" name="<?=$key?>" value="<?=$value?>" />
<?
}
?>
<div class="form-group input-icon-left">
<i class="fa fa-user"></i>
<input type="text" class="form-control" name="USER_LOGIN" value="<?=$arResult["LAST_LOGIN"]?>" placeholder="Логин">
</div>
<div class="form-group input-icon-left">
<i class="fa fa-lock"></i>
<input type="password" class="form-control" name="USER_PASSWORD" placeholder="Пароль">
</div>
<input type="submit" class="btn btn-primary btn-block" name="Login" value="Вход" />
<div class="form-actions">
<div class="checkbox">
<input type="checkbox" id="USER_REMEMBER" name="USER_REMEMBER" value="Y">
<label for="USER_REMEMBER">Запомнить меня</label>
</div>
</div>
</form>
<?
AddEventHandler("main", "OnBeforeUserUpdate", Array("Kudis", "picHandler"));
AddEventHandler("main", "OnBeforeUserAdd", Array("Kudis", "picHandler"));
define("MAX_WIDTH_DEF", 64);
define("MAX_HEIGHT_DEF", 32);
define("MAX_WIDTH_HD", 1024);
define("MAX_HEIGHT_HD", 512);
class Kudis
{
function picHandler($arFields)
{
$user_id=$USER->GetID();
$obGroups = CUser::GetUserGroupList($user_id);
while ($arGroup = $obGroups->Fetch()) {
if($arFields['GROUP_ID']=="6") {
if (is_array($arFields['UF_SKIN']) && !empty($arFields['UF_SKIN'])) {
$fileSize = CFile::GetImageSize ($arFields['UF_SKIN']['tmp_name']);
if ($fileSize[0] > MAX_WIDTH_DEF || $fileSize[1] > MAX_HEIGHT_DEF) {
global $APPLICATION;
$APPLICATION->throwException('Максимальный размер картинки для Вас: ' . MAX_WIDTH_DEF . 'x' . MAX_HEIGHT_DEF);
return false;
}
}
if (is_array($arFields['UF_CLOAK']) && !empty($arFields['UF_CLOAK'])) {
$fileSize = CFile::GetImageSize ($arFields['UF_CLOAK']['tmp_name']);
if ($fileSize[0] > MAX_WIDTH_DEF || $fileSize[1] > MAX_HEIGHT_DEF) {
global $APPLICATION;
$APPLICATION->throwException('Максимальный размер картинки для Вас: ' . MAX_WIDTH_DEF . 'x' . MAX_HEIGHT_DEF);
return false;
}
}
}
if($arFields['GROUP_ID']=="7") {
if (is_array($arFields['UF_SKIN']) && !empty($arFields['UF_SKIN'])) {
$fileSize = CFile::GetImageSize ($arFields['UF_SKIN']['tmp_name']);
if ($fileSize[0] > MAX_WIDTH_HD || $fileSize[1] > MAX_HEIGHT_HD) {
global $APPLICATION;
$APPLICATION->throwException('Максимальный размер картинки для Вас: ' . MAX_WIDTH_HD . 'x' . MAX_HEIGHT_HD);
return false;
}
}
if (is_array($arFields['UF_CLOAK']) && !empty($arFields['UF_CLOAK'])) {
$fileSize = CFile::GetImageSize ($arFields['UF_CLOAK']['tmp_name']);
if ($fileSize[0] > MAX_WIDTH_DEF || $fileSize[1] > MAX_HEIGHT_DEF) {
global $APPLICATION;
$APPLICATION->throwException('Максимальный размер картинки для Вас: ' . MAX_WIDTH_DEF . 'x' . MAX_HEIGHT_DEF);
return false;
}
}
}
if($arFields['GROUP_ID']=="8") {
if (is_array($arFields['UF_SKIN']) && !empty($arFields['UF_SKIN'])) {
$fileSize = CFile::GetImageSize ($arFields['UF_SKIN']['tmp_name']);
if ($fileSize[0] > MAX_WIDTH_HD || $fileSize[1] > MAX_HEIGHT_HD) {
global $APPLICATION;
$APPLICATION->throwException('Максимальный размер картинки для Вас: ' . MAX_WIDTH_HD . 'x' . MAX_HEIGHT_HD);
return false;
}
}
if (is_array($arFields['UF_CLOAK']) && !empty($arFields['UF_CLOAK'])) {
$fileSize = CFile::GetImageSize ($arFields['UF_CLOAK']['tmp_name']);
if ($fileSize[0] > MAX_WIDTH_HD || $fileSize[1] > MAX_HEIGHT_HD) {
global $APPLICATION;
$APPLICATION->throwException('Максимальный размер картинки для Вас: ' . MAX_WIDTH_HD . 'x' . MAX_HEIGHT_HD);
return false;
}
}
}
}
}
}
?>
<?
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$obGroups = CUser::GetUserGroupList(1);
$maxGroupId = 0;
while ($arGroup = $obGroups->Fetch()) {
if ($maxGroupId < $arGroup['GROUP_ID']) {
$maxGroupId = $arGroup['GROUP_ID'];
}
}
$obMaxGroup = CGroup::GetByID($maxGroupId);
if ($arMaxGroup = $obMaxGroup->Fetch()) {
echo $arMaxGroup['NAME'];
}
?>