| 1 | <?php |
|---|
| 2 | /* |
|---|
| 3 | * SAMS (Squid Account Management System) |
|---|
| 4 | * Author: Dmitry Chemerik chemerik@mail.ru |
|---|
| 5 | * (see the file 'main.php' for license details) |
|---|
| 6 | */ |
|---|
| 7 | |
|---|
| 8 | function AddGroup() |
|---|
| 9 | { |
|---|
| 10 | global $SAMSConf; |
|---|
| 11 | $DB=new SAMSDB(&$SAMSConf); |
|---|
| 12 | $lang="./lang/lang.$SAMSConf->LANG"; |
|---|
| 13 | require($lang); |
|---|
| 14 | |
|---|
| 15 | if($USERConf->ToWebInterfaceAccess("C")!=1 ) |
|---|
| 16 | exit(0); |
|---|
| 17 | |
|---|
| 18 | if(isset($_GET["groupnick"])) $groupnick=$_GET["groupnick"]; |
|---|
| 19 | |
|---|
| 20 | // $groupname=TempName(); |
|---|
| 21 | |
|---|
| 22 | $result=$DB->samsdb_query_value("SELECT s_name FROM sgroup where s_name = '$groupnick'"); |
|---|
| 23 | // $result=mysql_query("SELECT nick FROM groups where nick = '$groupnick';"); |
|---|
| 24 | if($result == 0) |
|---|
| 25 | { |
|---|
| 26 | $result=$DB->samsdb_query("INSERT INTO sgroup (s_name) VALUES('$groupnick') "); |
|---|
| 27 | $result=$DB->samsdb_query("INSERT INTO auth_param (s_auth, s_param, s_value) VALUES('ldap', 'ldapgroup', '$groupnick') "); |
|---|
| 28 | // if($result!=FALSE) |
|---|
| 29 | // UpdateLog("$SAMSConf->adminname","Added group $groupnick ","02"); |
|---|
| 30 | |
|---|
| 31 | print("<SCRIPT>\n"); |
|---|
| 32 | print(" parent.lframe.location.href=\"lframe.php\"; \n"); |
|---|
| 33 | print(" parent.tray.location.href=\"tray.php?show=usergrouptray&groupname=$groupname&groupnick=$groupnick\";\n"); |
|---|
| 34 | print("</SCRIPT> \n"); |
|---|
| 35 | } else { |
|---|
| 36 | PageTop("usergroup_48.jpg","$newgroupbuttom_5_addgroup_newgrpbuttom_5_groupexist"); |
|---|
| 37 | } |
|---|
| 38 | } |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | function AddShablon() |
|---|
| 42 | { |
|---|
| 43 | global $SAMSConf; |
|---|
| 44 | $DB=new SAMSDB(&$SAMSConf); |
|---|
| 45 | |
|---|
| 46 | $lang="./lang/lang.$SAMSConf->LANG"; |
|---|
| 47 | require($lang); |
|---|
| 48 | |
|---|
| 49 | if($USERConf->ToWebInterfaceAccess("C")!=1 ) |
|---|
| 50 | exit; |
|---|
| 51 | |
|---|
| 52 | $period="M"; |
|---|
| 53 | $clrdate="1980-01-01"; |
|---|
| 54 | if(isset($_GET["groupnick"])) $snick=$_GET["groupnick"]; |
|---|
| 55 | if(isset($_GET["defaulttraf"])) $defaulttraf=$_GET["defaulttraf"]; |
|---|
| 56 | if(isset($_GET["auth"])) $auth=$_GET["auth"]; |
|---|
| 57 | |
|---|
| 58 | if(isset($_GET["period"])) $period=$_GET["period"]; |
|---|
| 59 | if(isset($_GET["newperiod"])) $newperiod=$_GET["newperiod"]; |
|---|
| 60 | |
|---|
| 61 | if(isset($_GET["clryear"])) $clryear=$_GET["clryear"]; |
|---|
| 62 | if(isset($_GET["clrmonth"])) $clrmonth=$_GET["clrmonth"]; |
|---|
| 63 | if(isset($_GET["clrday"])) $clrday=$_GET["clrday"]; |
|---|
| 64 | if(isset($_GET["trange"])) $trange=$_GET["trange"]; |
|---|
| 65 | |
|---|
| 66 | if($period=="A") |
|---|
| 67 | { |
|---|
| 68 | $period=$newperiod; |
|---|
| 69 | $clrdate="$clryear-$clrmonth-$clrday"; |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | $DB->samsdb_query("INSERT INTO shablon ( s_name, s_quote, s_auth, s_period, s_clrdate, s_alldenied ) VALUES ( '$snick', '$defaulttraf', '$auth', '$period', '$clrdate', '0' ) "); |
|---|
| 73 | $DB->samsdb_query_value("SELECT s_shablon_id FROM shablon WHERE s_name='$snick' "); |
|---|
| 74 | $row=$DB->samsdb_fetch_array(); |
|---|
| 75 | $sid=$row['s_shablon_id']; |
|---|
| 76 | $DB->free_samsdb_query(); |
|---|
| 77 | $DB->samsdb_query("INSERT INTO sconfig_time ( s_shablon_id, s_trange_id ) VALUES ( '$sid', '$trange' ) "); |
|---|
| 78 | // UpdateLog("$SAMSConf->adminname","$shablonnew_AddShablon_1 $snick","01"); |
|---|
| 79 | |
|---|
| 80 | print("<SCRIPT>\n"); |
|---|
| 81 | print(" parent.lframe.location.href=\"lframe.php\"; \n"); |
|---|
| 82 | print("</SCRIPT> \n"); |
|---|
| 83 | } |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | function ImportFromLDAP() |
|---|
| 88 | { |
|---|
| 89 | include('ldap.php'); |
|---|
| 90 | |
|---|
| 91 | global $SAMSConf; |
|---|
| 92 | global $USERConf; |
|---|
| 93 | $DB=new SAMSDB(&$SAMSConf); |
|---|
| 94 | |
|---|
| 95 | $lang="./lang/lang.$SAMSConf->LANG"; |
|---|
| 96 | require($lang); |
|---|
| 97 | |
|---|
| 98 | if($USERConf->ToWebInterfaceAccess("C")!=1 ) |
|---|
| 99 | exit(0); |
|---|
| 100 | |
|---|
| 101 | PageTop("importfromldap-48.jpg"," $authadldbuttom_3_importfromldap_ImportFromLDAPForm_1 "); |
|---|
| 102 | |
|---|
| 103 | if(isset($_GET["addtemplates"])) $addtemplates=$_GET["addtemplates"]; |
|---|
| 104 | if(isset($_GET["addgroups"])) $addgroups=$_GET["addgroups"]; |
|---|
| 105 | if(isset($_GET["addgroupname"])) $addgroupname=$_GET["addgroupname"]; |
|---|
| 106 | |
|---|
| 107 | if(isset($_GET["defaulttraf"])) $defaulttraf=$_GET["defaulttraf"]; |
|---|
| 108 | |
|---|
| 109 | if(isset($_GET["period"])) $period=$_GET["period"]; |
|---|
| 110 | if(isset($_GET["newperiod"])) $newperiod=$_GET["newperiod"]; |
|---|
| 111 | |
|---|
| 112 | if(isset($_GET["clryear"])) $clryear=$_GET["clryear"]; |
|---|
| 113 | if(isset($_GET["clrmonth"])) $clrmonth=$_GET["clrmonth"]; |
|---|
| 114 | if(isset($_GET["clrday"])) $clrday=$_GET["clrday"]; |
|---|
| 115 | if(isset($_GET["trange"])) $trange=$_GET["trange"]; |
|---|
| 116 | |
|---|
| 117 | if(isset($_GET["enabled"])) $enabled=$_GET["enabled"]; |
|---|
| 118 | |
|---|
| 119 | $addgroups="on"; |
|---|
| 120 | $addtemplates="on"; |
|---|
| 121 | |
|---|
| 122 | if($enabled=="on") |
|---|
| 123 | $enabled=1; |
|---|
| 124 | else |
|---|
| 125 | $enabled=0; |
|---|
| 126 | if($period=="A") |
|---|
| 127 | { |
|---|
| 128 | $period=$newperiod; |
|---|
| 129 | $clrdate="$clryear-$clrmonth-$clrday"; |
|---|
| 130 | } |
|---|
| 131 | |
|---|
| 132 | $adldserver=GetAuthParameter("ldap","ldapserver"); |
|---|
| 133 | $basedn=GetAuthParameter("ldap","basedn"); |
|---|
| 134 | $adadmin=GetAuthParameter("ldap","adadmin"); |
|---|
| 135 | $adadminpasswd=GetAuthParameter("ldap","adadminpasswd"); |
|---|
| 136 | $usersrdn=GetAuthParameter("ldap","usersrdn"); |
|---|
| 137 | $usersfilter=GetAuthParameter("ldap","usersfilter"); |
|---|
| 138 | $usernameattr=GetAuthParameter("ldap","usernameattr"); |
|---|
| 139 | $groupsrdn=GetAuthParameter("ldap","groupsrdn"); |
|---|
| 140 | $groupsfilter=GetAuthParameter("ldap","groupsfilter"); |
|---|
| 141 | |
|---|
| 142 | $samsldap = new sams_ldap($adldserver, $basedn, $usersrdn, $usersfilter, $usernameattr, $groupsrdn, $groupsfilter, $adadmin, $adadminpasswd); |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | $i=0; |
|---|
| 148 | while(strlen($addgroupname[$i])>0) |
|---|
| 149 | { |
|---|
| 150 | if($addtemplates=="on") |
|---|
| 151 | { |
|---|
| 152 | echo "<B>ADD TEMPLATE:</B> $addgroupname[$i]"; |
|---|
| 153 | |
|---|
| 154 | $result=$DB->samsdb_query_value("SELECT s_name FROM shablon where s_name = '$addgroupname[$i]'"); |
|---|
| 155 | if($result == 0) |
|---|
| 156 | { |
|---|
| 157 | |
|---|
| 158 | if($clrdate=="") |
|---|
| 159 | $clrdate="1980-01-01"; |
|---|
| 160 | $DB->samsdb_query("INSERT INTO shablon ( s_name, s_quote, s_auth, s_period, s_clrdate, s_alldenied, s_shablon_id2 ) VALUES ( '$addgroupname[$i]', '$defaulttraf', 'ldap', '$period', '$clrdate', '0', '-1' ) "); |
|---|
| 161 | $DB->samsdb_query_value("SELECT s_shablon_id FROM shablon WHERE s_name='$addgroupname[$i]' "); |
|---|
| 162 | $row=$DB->samsdb_fetch_array(); |
|---|
| 163 | $sid=$row['s_shablon_id']; |
|---|
| 164 | $DB->free_samsdb_query(); |
|---|
| 165 | $DB->samsdb_query("INSERT INTO sconfig_time ( s_shablon_id, s_trange_id ) VALUES ( '$sid', '$trange' ) "); |
|---|
| 166 | echo " Ok"; |
|---|
| 167 | } |
|---|
| 168 | echo "<BR>"; |
|---|
| 169 | |
|---|
| 170 | } |
|---|
| 171 | if($addgroups=="on") |
|---|
| 172 | { |
|---|
| 173 | echo "<B>ADD GROUP:</B> $addgroupname[$i]"; |
|---|
| 174 | |
|---|
| 175 | $result=$DB->samsdb_query_value("SELECT s_name FROM sgroup where s_name = '$addgroupname[$i]'"); |
|---|
| 176 | if($result == 0) |
|---|
| 177 | { |
|---|
| 178 | $result=$DB->samsdb_query("INSERT INTO sgroup (s_name) VALUES('$addgroupname[$i]') "); |
|---|
| 179 | $result=$DB->samsdb_query("INSERT INTO auth_param (s_auth, s_param, s_value) VALUES('ldap', 'ldapgroup', '$addgroupname[$i]') "); |
|---|
| 180 | echo " Ok "; |
|---|
| 181 | } |
|---|
| 182 | echo "<BR>"; |
|---|
| 183 | |
|---|
| 184 | $result=$DB->samsdb_query_value("SELECT s_name, s_group_id FROM sgroup where s_name = '$addgroupname[$i]'"); |
|---|
| 185 | $row=$DB->samsdb_fetch_array(); |
|---|
| 186 | $groupid=$row['s_group_id']; |
|---|
| 187 | |
|---|
| 188 | $result=$DB->samsdb_query_value("SELECT s_name, s_shablon_id FROM shablon where s_name = '$addgroupname[$i]'"); |
|---|
| 189 | $row=$DB->samsdb_fetch_array(); |
|---|
| 190 | $shablonid=$row['s_shablon_id']; |
|---|
| 191 | |
|---|
| 192 | echo "<B>ADD USERS:</B><BR>"; |
|---|
| 193 | $b=$samsldap->GetUsersWithSecondaryGroupID($addgroupname[$i]); |
|---|
| 194 | for($j=0;$j<$b['userscount'];$j++) |
|---|
| 195 | { |
|---|
| 196 | $user=$b['uid'][$j]; |
|---|
| 197 | $username=$b['name'][$j]; |
|---|
| 198 | |
|---|
| 199 | if($enabled=="") |
|---|
| 200 | $enabled=0; |
|---|
| 201 | |
|---|
| 202 | $QUERY="INSERT INTO squiduser ( s_nick, s_domain, s_name, s_family, s_shablon_id, s_quote, s_size, s_enabled, s_group_id, s_soname, s_ip, s_passwd, s_hit, s_autherrorc, s_autherrort ) VALUES ( '$user', '$userdomain', '$name[0]', '".$name[$cname-1]."', '$shablonid', '$defaulttraf', '0', '$enabled', '$groupid', '$usersoname', '$userip', '$pass', '0', '0', '0') "; |
|---|
| 203 | |
|---|
| 204 | $DB->samsdb_query($QUERY); |
|---|
| 205 | echo " $user<BR>"; |
|---|
| 206 | } |
|---|
| 207 | |
|---|
| 208 | } |
|---|
| 209 | print(" <BR>"); |
|---|
| 210 | $i++; |
|---|
| 211 | } |
|---|
| 212 | print("<SCRIPT>\n"); |
|---|
| 213 | print(" parent.lframe.location.href=\"lframe.php\"; \n"); |
|---|
| 214 | print(" parent.tray.location.href=\"tray.php?show=usergrouptray&groupname=$groupname&groupnick=$groupnick\";\n"); |
|---|
| 215 | print("</SCRIPT> \n"); |
|---|
| 216 | |
|---|
| 217 | } |
|---|
| 218 | |
|---|
| 219 | function ImportFromLDAPForm() |
|---|
| 220 | { |
|---|
| 221 | global $SAMSConf; |
|---|
| 222 | global $USERConf; |
|---|
| 223 | |
|---|
| 224 | $lang="./lang/lang.$SAMSConf->LANG"; |
|---|
| 225 | require($lang); |
|---|
| 226 | |
|---|
| 227 | if($USERConf->ToWebInterfaceAccess("C")!=1 ) |
|---|
| 228 | exit(0); |
|---|
| 229 | |
|---|
| 230 | $DB=new SAMSDB(&$SAMSConf); |
|---|
| 231 | |
|---|
| 232 | PageTop("importfromldap-48.jpg"," $authadldbuttom_3_importfromldap_ImportFromLDAPForm_1 "); |
|---|
| 233 | |
|---|
| 234 | require_once("src/ldap.php"); |
|---|
| 235 | |
|---|
| 236 | print("<FORM NAME=\"AddDomainUsers\" ACTION=\"main.php\">\n"); |
|---|
| 237 | |
|---|
| 238 | $adldserver=GetAuthParameter("ldap","ldapserver"); |
|---|
| 239 | $basedn=GetAuthParameter("ldap","basedn"); |
|---|
| 240 | $adadmin=GetAuthParameter("ldap","adadmin"); |
|---|
| 241 | $adadminpasswd=GetAuthParameter("ldap","adadminpasswd"); |
|---|
| 242 | $usersrdn=GetAuthParameter("ldap","usersrdn"); |
|---|
| 243 | $usersfilter=GetAuthParameter("ldap","usersfilter"); |
|---|
| 244 | $usernameattr=GetAuthParameter("ldap","usernameattr"); |
|---|
| 245 | $groupsrdn=GetAuthParameter("ldap","groupsrdn"); |
|---|
| 246 | $groupsfilter=GetAuthParameter("ldap","groupsfilter"); |
|---|
| 247 | |
|---|
| 248 | $samsldap = new sams_ldap($adldserver, $basedn, $usersrdn, $usersfilter, $usernameattr, $groupsrdn, $groupsfilter, $adadmin, $adadminpasswd); |
|---|
| 249 | |
|---|
| 250 | print("<FORM NAME=\"AddFromAD\" ACTION=\"main.php\">\n"); |
|---|
| 251 | print("<INPUT TYPE=\"HIDDEN\" NAME=\"show\" id=Show value=\"exe\">\n"); |
|---|
| 252 | print("<INPUT TYPE=\"HIDDEN\" NAME=\"function\" id=function value=\"importfromldap\">\n"); |
|---|
| 253 | print("<INPUT TYPE=\"HIDDEN\" NAME=\"filename\" id=filename value=\"authldapbuttom_3_importfromldap.php\">\n"); |
|---|
| 254 | /* */ |
|---|
| 255 | |
|---|
| 256 | $groupinfo=$samsldap->GetGroupsData(); |
|---|
| 257 | |
|---|
| 258 | echo "<TABLE WIDTH=90%>"; |
|---|
| 259 | print("<TR><TD WIDTH=30%><B>$authadldbuttom_3_importfromldap_ImportFromLDAPForm_2:\n"); |
|---|
| 260 | print("<TD WIDTH=70%><SELECT NAME=\"addgroupname[]\" SIZE=15 TABINDEX=30 MULTIPLE>\n"); |
|---|
| 261 | |
|---|
| 262 | for($i=0;$i<$groupinfo['groupscount'];$i++) |
|---|
| 263 | { |
|---|
| 264 | $groupname=$groupinfo['cn'][$i]; |
|---|
| 265 | $gid=$groupinfo['gidNumber'][$i]; |
|---|
| 266 | if(SearchAuthParameter("ldap","ldapgroup","$groupname")==0) |
|---|
| 267 | print("<OPTION VALUE=\"$groupname\"> $groupname \n"); |
|---|
| 268 | |
|---|
| 269 | } |
|---|
| 270 | |
|---|
| 271 | print("</SELECT>\n"); |
|---|
| 272 | |
|---|
| 273 | print("<TR><TD><B>$usersbuttom_1_domain_AddUsersFromDomainForm_6"); |
|---|
| 274 | print("<TD><INPUT TYPE=\"CHECKBOX\" NAME=\"enabled\" CHECKED>"); |
|---|
| 275 | |
|---|
| 276 | /* |
|---|
| 277 | print("<TR><TD WIDTH=30%><B>Create SAMS templates with LDAP groups name:\n"); |
|---|
| 278 | print("<TD><INPUT TYPE=\"CHECKBOX\" NAME=\"addtemplates\" CHECKED onclick=ADTempaletesEnabled(AddDomainUsers)>"); |
|---|
| 279 | |
|---|
| 280 | print("<SCRIPT LANGUAGE=JAVASCRIPT> \n"); |
|---|
| 281 | print("function ADTempaletesEnabled(formname) \n"); |
|---|
| 282 | print("{ \n"); |
|---|
| 283 | print(" if(formname.addtemplates.checked==true) \n"); |
|---|
| 284 | print(" {\n"); |
|---|
| 285 | print(" formname.defaulttraf.disabled=false; \n"); |
|---|
| 286 | print(" formname.period.disabled=false; \n"); |
|---|
| 287 | print(" EnterPeriod(formname); \n"); |
|---|
| 288 | print(" formname.trange.disabled=false; \n"); |
|---|
| 289 | print(" }\n"); |
|---|
| 290 | print(" else \n"); |
|---|
| 291 | print(" {\n"); |
|---|
| 292 | print(" formname.defaulttraf.disabled=true; \n"); |
|---|
| 293 | print(" formname.period.disabled=true; \n"); |
|---|
| 294 | // print(" EnterPeriod(formname); \n"); |
|---|
| 295 | print(" formname.newperiod.disabled=true; \n"); |
|---|
| 296 | print(" formname.clryear.disabled=true; \n"); |
|---|
| 297 | print(" formname.clrmonth.disabled=true; \n"); |
|---|
| 298 | print(" formname.clrday.disabled=true; \n"); |
|---|
| 299 | print(" formname.trange.disabled=true; \n"); |
|---|
| 300 | print(" }\n"); |
|---|
| 301 | print("}\n"); |
|---|
| 302 | print("</SCRIPT> \n"); |
|---|
| 303 | */ |
|---|
| 304 | print("<TR>\n"); |
|---|
| 305 | print("<TD>\n"); |
|---|
| 306 | print("$shablonnew_NewShablonForm_3:\n"); |
|---|
| 307 | print("<TD>\n"); |
|---|
| 308 | print("<INPUT TYPE=\"TEXT\" NAME=\"defaulttraf\" SIZE=6 VALUE=\"100\"> <B> 0 - unlimited traffic\n" ); |
|---|
| 309 | |
|---|
| 310 | print("<TR>\n"); |
|---|
| 311 | print("<TD>\n"); |
|---|
| 312 | print("$shablonnew_NewShablonForm_10\n"); |
|---|
| 313 | print("<TD>\n"); |
|---|
| 314 | print("<SELECT NAME=\"period\" onchange=EnterPeriod(AddDomainUsers) $CCLEAN> \n"); |
|---|
| 315 | print("<OPTION value=\"M\" SELECTED>$shablonnew_NewShablonForm_11\n"); |
|---|
| 316 | print("<OPTION value=\"W\">$shablonnew_NewShablonForm_12\n"); |
|---|
| 317 | print("<OPTION value=\"A\">$shablonnew_NewShablonForm_13\n"); |
|---|
| 318 | print("</SELECT>\n"); |
|---|
| 319 | |
|---|
| 320 | print("<SCRIPT LANGUAGE=JAVASCRIPT> \n"); |
|---|
| 321 | print("function EnterPeriod(formname) \n"); |
|---|
| 322 | print("{ \n"); |
|---|
| 323 | print(" var period=formname.period.value; \n"); |
|---|
| 324 | print(" var clryear=formname.clryear.value; \n"); |
|---|
| 325 | print(" var clrmonth=formname.clrmonth.value; \n"); |
|---|
| 326 | print(" var clrday=formname.clrday.value; \n"); |
|---|
| 327 | //print(" value=window.confirm(\"1? \" );\n"); |
|---|
| 328 | print(" if(period==\"A\") \n"); |
|---|
| 329 | print(" {\n"); |
|---|
| 330 | print(" formname.newperiod.disabled=false; \n"); |
|---|
| 331 | print(" formname.clryear.disabled=false; \n"); |
|---|
| 332 | print(" formname.clrmonth.disabled=false; \n"); |
|---|
| 333 | print(" formname.clrday.disabled=false; \n"); |
|---|
| 334 | print(" }\n"); |
|---|
| 335 | print(" else \n"); |
|---|
| 336 | print(" {\n"); |
|---|
| 337 | print(" formname.newperiod.disabled=true; \n"); |
|---|
| 338 | print(" formname.clryear.disabled=true; \n"); |
|---|
| 339 | print(" formname.clrmonth.disabled=true; \n"); |
|---|
| 340 | print(" formname.clrday.disabled=true; \n"); |
|---|
| 341 | print(" }\n"); |
|---|
| 342 | print("}\n"); |
|---|
| 343 | print("</SCRIPT> \n"); |
|---|
| 344 | $month=array(0,1,2,3,4,5,6,7,8,9,10,11,12); |
|---|
| 345 | $days=array(0,31,28,31,30,31,30,31,31,30,31,30,31); |
|---|
| 346 | $YCLRVALUE=strftime("%Y"); |
|---|
| 347 | $MCLRVALUE=strftime("%m"); |
|---|
| 348 | $DCLRVALUE=strftime("%d"); |
|---|
| 349 | if($DCLRVALUE+1>$days[$MCLRVALUE]) |
|---|
| 350 | { |
|---|
| 351 | $DCLRVALUE=1; |
|---|
| 352 | $MCLRVALUE+=1; |
|---|
| 353 | if($MCLRVALUE>12) |
|---|
| 354 | { |
|---|
| 355 | $MCLRVALUE=1; |
|---|
| 356 | $YCLRVALUE+=1; |
|---|
| 357 | } |
|---|
| 358 | } |
|---|
| 359 | else |
|---|
| 360 | $DCLRVALUE+=1; |
|---|
| 361 | print("<TR><TD>\n"); |
|---|
| 362 | print("<TD> $shablonnew_NewShablonForm_14: \n"); |
|---|
| 363 | print("<INPUT TYPE=\"TEXT\" NAME=\"newperiod\" SIZE=5 DISABLED>$shablonnew_NewShablonForm_15\n"); |
|---|
| 364 | print("<TR><TD><TD> $shablonnew_NewShablonForm_16: \n"); |
|---|
| 365 | print("<BR><INPUT TYPE=\"TEXT\" NAME=\"clryear\" SIZE=4 DISABLED VALUE=\"$YCLRVALUE\">:\n"); |
|---|
| 366 | print("<INPUT TYPE=\"TEXT\" NAME=\"clrmonth\" SIZE=2 DISABLED VALUE=\"$MCLRVALUE\">:\n"); |
|---|
| 367 | print("<INPUT TYPE=\"TEXT\" NAME=\"clrday\" SIZE=2 DISABLED VALUE=\"$DCLRVALUE\">\n"); |
|---|
| 368 | |
|---|
| 369 | print("<TR><TD>$AddTRangeForm_trangetray_1:<TD><SELECT NAME=\"trange\" ID=\"trange\" >\n"); |
|---|
| 370 | $num_rows=$DB->samsdb_query_value("SELECT * FROM timerange "); |
|---|
| 371 | while($row=$DB->samsdb_fetch_array()) |
|---|
| 372 | { |
|---|
| 373 | print("<OPTION VALUE=$row[s_trange_id]> $row[s_name] ($row[s_timestart] - $row[s_timeend] )"); |
|---|
| 374 | |
|---|
| 375 | } |
|---|
| 376 | print("</SELECT>\n"); |
|---|
| 377 | |
|---|
| 378 | |
|---|
| 379 | |
|---|
| 380 | /* |
|---|
| 381 | print("<TR><TD WIDTH=30%><B>Create SAMS groups with AD groups name:\n"); |
|---|
| 382 | print("<TD><INPUT TYPE=\"CHECKBOX\" NAME=\"addgroups\" CHECKED>"); |
|---|
| 383 | */ |
|---|
| 384 | echo "</TABLE>"; |
|---|
| 385 | print("<INPUT TYPE=\"SUBMIT\" value=\"Import\">\n"); |
|---|
| 386 | print("</FORM>\n"); |
|---|
| 387 | |
|---|
| 388 | } |
|---|
| 389 | |
|---|
| 390 | |
|---|
| 391 | |
|---|
| 392 | function authldapbuttom_3_importfromldap() |
|---|
| 393 | { |
|---|
| 394 | global $SAMSConf; |
|---|
| 395 | global $USERConf; |
|---|
| 396 | |
|---|
| 397 | $lang="./lang/lang.$SAMSConf->LANG"; |
|---|
| 398 | require($lang); |
|---|
| 399 | |
|---|
| 400 | if($USERConf->ToWebInterfaceAccess("C")==1 ) |
|---|
| 401 | { |
|---|
| 402 | GraphButton("main.php?show=exe&function=importfromldapform&filename=authldapbuttom_3_importfromldap.php","basefrm","importfromldap-32.jpg","importfromldap-48.jpg","$authadldbuttom_3_importfromldap_ImportFromLDAPForm_1"); |
|---|
| 403 | } |
|---|
| 404 | |
|---|
| 405 | } |
|---|
| 406 | |
|---|
| 407 | ?> |
|---|