Файл: _rootadmin/_usersettings.inc.php
Строк: 698
<?
$user = GetUserById($id);
if (!$user) { $user = GetUserByLogin($id); }
if ($user) {
print menu_admin_client($user->id);
if ($sub == 'edit') {
if($passwd and crypt($passwd,$user->password) != $user->password) {
if (checkAdminAccess('clientPasswordEdit')) {
@mysql_query("UPDATE users SET password='".crypt($passwd)."' WHERE id='$user->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
writeAdminLog("Изменен пароль клиента ID # $user->id, $user->login");
print "Пароль успешно изменен.<BR>";
} else {
print "Пароль не изменен, т.к. у Вас не хватает прав доступа.<BR>";
}
}
checkAdminAccess('clientSettingsEdit',1);
if ($news) {$newstomysql = 1;}
else {$newstomysql = 0;}
if ($domainreseller) {$domainresellertomysql = 1;}
else {$domainresellertomysql = 0;}
if ($api) {$apitomysql = 1;}
else {$apitomysql = 0;}
if ($apih) {$apihtomysql = 1;}
else {$apihtomysql = 0;}
if ($noSuspend) {$nosuspendtomysql = 1;}
else {$nosuspendtomysql = 0;}
if ($specPartnerEnable) {$specPartnerEnablemysql = 1;}
else {$specPartnerEnablemysql = 0;}
$allowedPaymentsToMySQL = @join(":x:",$allowedPayments);
$disallowedPaymentsToMySQL = @join(":x:",$disallowedPayments);
$disallowedMenusToMySQL = @join(":x:",$disallowedMenus);
$user->news = $newstomysql;
$user->domainreseller = $domainresellertomysql;
$user->api = $apitomysql;
$user->apih = $apihtomysql;
$user->apikey = $apikey;
$user->surname = $surname;
$user->name = $name;
$user->otchestvo = $otchestvo;
$user->email = $email;
$user->email2 = $email2;
$user->codeWord = $codeWord;
$user->currency = $userCurrency;
$user->lang = $newlang;
$user->icq = $icq;
$user->skype = $skype;
$user->wmz = $wmz;
$user->wmr = $wmr;
$user->noSuspend = $nosuspendtomysql;
$user->autoRenew = $autoRenew;
$user->attachPDFtoBill = $attachPDFtoBill;
$user->allowDomainPush = $allowDomainPush;
$user->mobile=$mobile;
$user->mobileVerification=$mobileVerification;
$user->smsUserBillRemind=$smsUserBillRemind;
$user->smsUserOrderRemind=$smsUserOrderRemind;
$user->smsUserOrderDomainRemind=$smsUserOrderDomainRemind;
$user->smsUserOrderShopRemind=$smsUserOrderShopRemind;
$user->smsUserTicketNew=$smsUserTicketNew;
$user->smsUserBillNew=$smsUserBillNew;
$user->smsUserOrderSuspend=$smsUserOrderSuspend;
$user->partnerMaxReferals=$partnerMaxReferals;
$user->referal=$referal;
$user->panelClientId=$panelClientId;
$user->panelClientLogin=$panelClientLogin;
$user->panelClientPassword=encodePwd($panelClientPassword);
$user->banned=$banned;
$user->specialPromoCode=$specialPromoCode;
$user->specialPromoCodeForUser=$specialPromoCodeForUser;
$user->specialPromoCodeForReferals=$specialPromoCodeForReferals;
$user->allowedPayments = $allowedPaymentsToMySQL;
$user->disallowedPayments = $disallowedPaymentsToMySQL;
$user->disallowedMenus = $disallowedMenusToMySQL;
@mysql_query("UPDATE users SET name='$name',surname='$surname',otchestvo='$otchestvo',email='$email',email2='$email2',news='$newstomysql',domainreseller='$domainresellertomysql',api='$apitomysql',apih='$apihtomysql',apikey='$apikey',codeWord='$codeWord',currency='$userCurrency',lang='$newlang',icq='$icq',skype='$skype',wmz='$wmz',wmr='$wmr',noSuspend='$nosuspendtomysql',autoRenew='$autoRenew',attachPDFtoBill='$attachPDFtoBill',allowDomainPush='$allowDomainPush',mobile='$mobile',mobileVerification='$mobileVerification',smsUserBillRemind='$smsUserBillRemind',smsUserOrderRemind='$smsUserOrderRemind',smsUserOrderDomainRemind='$smsUserOrderDomainRemind',smsUserOrderShopRemind='$smsUserOrderShopRemind',smsUserOrderSuspend='$smsUserOrderSuspend',smsUserTicketNew='$smsUserTicketNew',smsUserBillNew='$smsUserBillNew',partnerMaxReferals='$partnerMaxReferals',referal='$referal',panelClientId='$panelClientId',panelClientLogin='$panelClientLogin',panelClientPassword='".encodePwd($panelClientPassword)."',banned='$banned',specialPromoCode='$specialPromoCode',specialPromoCodeForUser='$specialPromoCodeForUser',specialPromoCodeForReferals='$specialPromoCodeForReferals',allowedPayments='$allowedPaymentsToMySQL',disallowedPayments='$disallowedPaymentsToMySQL',disallowedMenus='$disallowedMenusToMySQL' WHERE id='$user->id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
writeAdminLog("Изменены настройки клиента ID # $user->id, $user->login");
print "Настройки успешно изменены.<BR><BR>";
}
checkAdminAccess('clientSettingsRead',1);
$weSalesTypes = GetSetting("weSalesTypes");
$weSalesTypes = @mb_split("::",$weSalesTypes);
if ($user->news) {$newscheckbox = "checked";}
else {$newscheckbox = "";}
if ($user->domainreseller) {$domainresellercheckbox = "checked";}
else {$domainresellercheckbox = "";}
if ($user->api) {$apicheckbox = "checked";}
else {$apicheckbox = "";}
if ($user->apih) {$apihcheckbox = "checked";}
else {$apihcheckbox = "";}
if ($user->noSuspend) {$nosuspendcheckbox = "checked";}
else {$nosuspendcheckbox = "";}
if ($user->specialPromoCodeForReferals) {$specialPromoCodeForReferalsCheckbox = "checked";}
else {$specialPromoCodeForReferalsCheckbox = "";}
if ($user->specialPromoCodeForUser) {$specialPromoCodeForUserCheckbox = "checked";}
else {$specialPromoCodeForUserCheckbox = "";}
?>
<table border=0><form method=post>
<tr><td colspan=2 align=center bgcolor=<? print $font_head?>><B>Настройки клиента <? print $user->login?></b></td></tr>
<input type=hidden name=do value=<? print $do?>>
<input type=hidden name=sub value=edit>
<input type=hidden name=id value=<? print $user->id?>>
<?
if ($user->banned == "0") {$bannedNoCheck = "checked";}
if ($user->banned == "1") {$bannedYesCheck = "checked";}
print "<tr><td>Блокировка аккаунта:</td><td><input type=radio name=banned value=0 $bannedNoCheck> аккаунт активен <input type=radio name=banned value=1 $bannedYesCheck> аккаунт заблокирован</td></tr>";
print "<tr><td>Валюта сайта:</td><td><select class=input name=userCurrency><option>Валюта по умолчанию</option>";
if (GetSetting("usersChangeCurrency")) {
$r = GetCurrencys();
while ($rr = mysql_fetch_object($r)) {
if ($rr->code == $user->currency) { $selected = "selected"; } else { $selected = ""; }
print "<option value='$rr->code' $selected>$rr->name</option>";
}
}
print "</select></td></tr>";
if (GetSetting("lngUsersCanChange") and GetSetting("lngSelectAtProfile")) {
print "<tr><td>Язык:</td><td>"; printLanguagesSelet($user->lang); print "</td></tr>";
}
if ($user->autoRenew == "0") {$autoDefaultCheck = "checked";}
if ($user->autoRenew == "1") {$autoYesCheck = "checked";}
if ($user->autoRenew == "2") {$autoNoCheck = "checked";}
if ($user->attachPDFtoBill == "0") {$attachDefaultCheck = "checked";}
if ($user->attachPDFtoBill == "1") {$attachYesCheck = "checked";}
if ($user->attachPDFtoBill == "2") {$attachNoCheck = "checked";}
if ($user->allowDomainPush == "0") {$pushDefaultCheck = "checked";}
if ($user->allowDomainPush == "1") {$pushYesCheck = "checked";}
if ($user->allowDomainPush == "2") {$pushNoCheck = "checked";}
if ($user->specPartnerEnable) {$partnerCheck = "checked";} else { $partnerCheck = ""; }
if (GetSetting("registerNeedMobile") == 2 and GetSetting("registerNeedMobileVerification")) {
if ($user->mobileVerification == "1") {$mobileVerificationCheck = "checked";} else { $mobileVerificationCheck = ""; }
$mobileVerificationInput = "<BR><input type=checkbox name=mobileVerification value=1 $mobileVerificationCheck size=40> номер подтвержден";
} else {
$mobileVerificationInput = "<input type=hidden name=mobileVerification value=$user->mobileVerification>";
}
print "
<tr><td>Подписка на новости:</td><td><input type=checkbox $newscheckbox name=news size=40> да</td></tr>
<tr><td>Реселлер доменов:</td><td><input type=checkbox $domainresellercheckbox name=domainreseller size=40> да</td></tr>
<tr><td>Запретить автоостановку аккаунтов:</td><td><input type=checkbox $nosuspendcheckbox name=noSuspend size=40> да</td></tr>
<tr><td>Автопродление заказов:</td><td><input type=radio name=autoRenew value=0 $autoDefaultCheck> по умолчанию <input type=radio name=autoRenew value=1 $autoYesCheck> включено <input type=radio name=autoRenew value=2 $autoNoCheck> отключено</td></tr>
<tr><td>Прикреплять PDF к счетам:</td><td><input type=radio name=attachPDFtoBill value=0 $attachDefaultCheck size=40> по умолчанию <input type=radio name=attachPDFtoBill value=1 $attachYesCheck size=40> включено <input type=radio name=attachPDFtoBill value=2 $attachNoCheck size=40> отключено</td></tr>
<tr><td>Push (перенос) доменов:</td><td><input type=radio name=allowDomainPush value=0 $pushDefaultCheck size=40> по умолчанию <input type=radio name=allowDomainPush value=1 $pushYesCheck size=40> включено <input type=radio name=allowDomainPush value=2 $pushNoCheck size=40> отключено</td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Доступ к API</b></td></tr>
<tr><td>Включить доступ к API (домены):</td><td><input type=checkbox $apicheckbox name=api size=40> да</td></tr>
<tr><td>Включить доступ к API (хостинг, сервера):</td><td><input type=checkbox $apihcheckbox name=apih size=40> да</td></tr>
<tr><td>API Key:</td><td><input type=text name=apikey value="$user->apikey" size=40></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Специальная скидка</b></td></tr>
<tr><td>Промо-код:</td><td><input type=text name=specialPromoCode value="$user->specialPromoCode" size=40></td></tr>
<tr><td>Использовать для клиента:<img src='./_rootimages/question.gif' alt='Если клиент не указал при заказе никакой промо-код, то промо-код, указанный выше, будет использован принудительно.'></td><td><input type=checkbox $specialPromoCodeForUserCheckbox name=specialPromoCodeForUser value=1> да</td></tr>
<tr><td>Использовать для рефералов:<img src='./_rootimages/question.gif' alt='Если клиент, который зарегистрировался по партнерской ссылке данного пользователя, не указал при заказе никакой промо-код, то промо-код, указанный выше, будет использован принудительно.'></td><td><input type=checkbox $specialPromoCodeForReferalsCheckbox name=specialPromoCodeForReferals value=1> да</td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Платежные реквизиты</b></td></tr>
<tr><td>WMZ кошелек:</td><td><input type=text name=wmz value="$user->wmz" size=40></td></tr>
<tr><td>WMR кошелек:</td><td><input type=text name=wmr value="$user->wmr" size=40></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Контактная информация</b></td></tr>
<tr><td>Фамилия:</td><td><input type=text name=surname value="$user->surname" size=40></td></tr>
<tr><td>Имя:</td><td><input type=text name=name value="$user->name" size=40></td></tr>
<tr><td>Отчество:</td><td><input type=text name=otchestvo value="$user->otchestvo" size=40></td></tr>
<tr><td>E-mail:</td><td><input type=text name=email value="$user->email" size=40></td></tr>
<tr><td>Альтернативный E-mail:</td><td><input type=text name=email2 value="$user->email2" size=40></td></tr>
<tr><td valign=top>Мобильный телефон:</td><td><input type=text name=mobile value="$user->mobile" size=40>$mobileVerificationInput</td></tr>
<tr><td>ICQ:</td><td><input type=text name=icq value="$user->icq" size=40></td></tr>
<tr><td>Skype:</td><td><input type=text name=skype value="$user->skype" size=40></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Изменение пароля</b></td></tr>
<tr><td>Новый пароль:</td><td><input type=password name=passwd size=40></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Кодовое слово</b></td></tr>
<tr><td>Кодовое слово:</td><td><input type=text name=codeWord value="$user->codeWord" size=40></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Партнерская программа</b></td></tr>
<tr><td>Макс. кол-во рефералов:<img src='./_rootimages/question.gif' alt='Максимальное количество рефералов, которых может привести клиент и получать за них проценты от продаж.<BR><BR>0 - используется глобальное значение из настроек партнерской программы.'></td><Td align=left><input type=text name=partnerMaxReferals size=5 value=$user->partnerMaxReferals></td></tr>
<tr><td>ID реферала:<img src='./_rootimages/question.gif' alt='ID пользователя, по рекомендации которого зарегистрировался данный клиент'></td><Td align=left><input type=text name=referal size=5 value=$user->referal></td></tr>
";
if (GetSetting("smsGateway")) {
$GsmsUserBillRemind = GetSetting("smsUserBillRemind");
$GsmsUserOrderRemind = GetSetting("smsUserOrderRemind");
$GsmsUserOrderDomainRemind = GetSetting("smsUserOrderDomainRemind");
$GsmsUserOrderShopRemind = GetSetting("smsUserOrderShopRemind");
$GsmsUserTicketNew = GetSetting("smsUserTicketNew");
$GsmsUserBillNew = GetSetting("smsUserBillNew");
$GsmsUserOrderSuspend = GetSetting("smsUserOrderSuspend");
if ($GsmsUserBillRemind or $GsmsUserOrderRemind or $GsmsUserOrderDomainRemind or $GsmsUserOrderShopRemind or $GsmsUserTicketNew or $GsmsUserBillNew or $GsmsUserOrderSuspend) {
print "<tr><td colspan=2 align=center bgcolor=$font_head><B>".$_lang[SettingsSMS]."</b></td></tr>";
if ($GsmsUserBillRemind) { ?><tr><td colspan=2><input type=checkbox name=smsUserBillRemind value=1 <? if ($user->smsUserBillRemind) {print "checked";} ?>> <? print $_lang[SettingsSMSBillRemind]?></td></tr><? }
if ($GsmsUserOrderRemind) { ?><tr><td colspan=2><input type=checkbox name=smsUserOrderRemind value=1 <? if ($user->smsUserOrderRemind) {print "checked";} ?>> <? print $_lang[SettingsSMSOrderRemind]?></td></tr><? }
if ($GsmsUserOrderDomainRemind) { ?><tr><td colspan=2><input type=checkbox name=smsUserOrderDomainRemind value=1 <? if ($user->smsUserOrderDomainRemind) {print "checked";} ?>> <? print $_lang[SettingsSMSOrderDomainRemind]?></td></tr><? }
if ($GsmsUserOrderShopRemind) { ?><tr><td colspan=2><input type=checkbox name=smsUserOrderShopRemind value=1 <? if ($user->smsUserOrderShopRemind) {print "checked";} ?>> <? print $_lang[SettingsSMSOrderShopRemind]?></td></tr><? }
if ($GsmsUserOrderSuspend) { ?><tr><td colspan=2><input type=checkbox name=smsUserOrderSuspend value=1 <? if ($user->smsUserOrderSuspend) {print "checked";} ?>> <? print $_lang[SettingsSMSOrderSuspend]?></td></tr><? }
if ($GsmsUserBillNew) { ?><tr><td colspan=2><input type=checkbox name=smsUserBillNew value=1 <? if ($user->smsUserBillNew) {print "checked";} ?>> <? print $_lang[SettingsSMSBillNew]?></td></tr><? }
if ($GsmsUserTicketNew) { ?><tr><td colspan=2><input type=checkbox name=smsUserTicketNew value=1 <? if ($user->smsUserTicketNew) {print "checked";} ?>> <? print $_lang[SettingsSMSTicketNew]?></td></tr><? }
}
}
print "
<tr><td colspan=2><BR></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Доступные платежные системы <img src='./_rootimages/question.gif' alt='Жирным шрифтом выделены платежные системы, которые доступны по умолчанию.'></b></td></tr>
<tr><td align=center bgcolor=$font_head>Разрешить доступ</td><td align=center bgcolor=$font_head>Запретить доступ</td></tr>";
print "<tr><td>";
$allowedPayments = @mb_split(":x:",$user->allowedPayments);
$q = @mysql_query("select * from pay_systems order by sort,id") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
while ($qq = @mysql_fetch_object($q)) {
$paySystem = GetPaymentSystemById($qq->id);
if ( @in_array($qq->id,$allowedPayments)) { $checked="checked"; } else { $checked = ""; }
if ($paySystem->isdefault) { $qq->name = "<B>".$qq->name."</B>"; }
print "<input type=checkbox name=allowedPayments[] value='$qq->id' $checked> $qq->name<BR>";
}
print "</td><td>";
$disallowedPayments = @mb_split(":x:",$user->disallowedPayments);
$q = @mysql_query("select * from pay_systems order by sort,id") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
while ($qq = @mysql_fetch_object($q)) {
$paySystem = GetPaymentSystemById($qq->id);
if ( @in_array($qq->id,$disallowedPayments)) { $checked="checked"; } else { $checked = ""; }
if ($paySystem->isdefault) { $qq->name = "<B>".$qq->name."</B>"; }
print "<input type=checkbox name=disallowedPayments[] value='$qq->id' $checked> $qq->name<BR>";
}
print "</td></tr>";
if (@in_array("hosting",$weSalesTypes) or @in_array("reseller",$weSalesTypes) or @in_array("vds",$weSalesTypes) or @in_array("dedicated",$weSalesTypes) or @in_array("vpn",$weSalesTypes) or @in_array("ssh",$weSalesTypes)) {
print "
<tr><td colspan=2><BR></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Служебная информация</b></td></tr>
<tr><td>panelClientId:</td><td><input type=text name=panelClientId value="$user->panelClientId" size=40></td></tr>
<tr><td>panelClientLogin:</td><td><input type=text name=panelClientLogin value="$user->panelClientLogin" size=40></td></tr>
<tr><td>panelClientPassword:</td><td><input type=text name=panelClientPassword value="".decodePwd($user->panelClientPassword)."" size=40></td></tr>
";
} else {
print "
<input type=hidden name=panelClientId value="$user->panelClientId" size=40>
<input type=hidden name=panelClientLogin value="$user->panelClientLogin" size=40>
<input type=hidden name=panelClientPassword value="".decodePwd($user->panelClientPassword)."" size=40>
";
}
print "
<tr><td colspan=2><BR></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Не отображать пункты меню <img src='./_rootimages/question.gif' alt='Отмеченные пункты не будут видны клиенту в меню клиентской части биллинга.'></b></td></tr>
";
print "<tr><td colspan=2>";
$disallowedMenus = @mb_split(":x:",$user->disallowedMenus);
while (list($i,$v) = each($_menus)) {
if ( @in_array($i,$disallowedMenus)) { $checked="checked"; } else { $checked = ""; }
print "<input type=checkbox name=disallowedMenus[] value='$i' $checked> $v ";
}
$r = GetUsersMenu();
while ($rr = @mysql_fetch_object($r)) {
$name=array();
$name = parseRPStrArray($rr->name,":xxx:",":xx:");
$name = $name[russian];
if ( @in_array("id".$rr->id,$disallowedMenus)) { $checked="checked"; } else { $checked = ""; }
print "<input type=checkbox name=disallowedMenus[] value='id$rr->id' $checked> $name ";
}
print "</td></tr>";
print "
<tr><td colspan=2><BR></td></tr>
<tr><td colspan=2 align=center bgcolor=$font_head><B>Служебная информация</b></td></tr>
<tr><td>panelClientId:</td><td><input type=text name=panelClientId value="$user->panelClientId" size=40></td></tr>
<tr><td>panelClientLogin:</td><td><input type=text name=panelClientLogin value="$user->panelClientLogin" size=40></td></tr>
<tr><td>panelClientPassword:</td><td><input type=text name=panelClientPassword value="".decodePwd($user->panelClientPassword)."" size=40></td></tr>
";
print "<tr><td colspan=2 align=center><BR><input type=Submit value=Сохранить></td></tr></table><BR></form>";
}
else {
print "Клиент не найден.";
}
?>