Current Path : /home/bitrix/ext_www/crm.klimatlend.ua/passwordreset/ |
Current File : /home/bitrix/ext_www/crm.klimatlend.ua/passwordreset/index.php |
<? define("STOP_STATISTICS", true); define("NO_KEEP_STATISTIC", 'Y'); define("NO_AGENT_STATISTIC",'Y'); define("NO_AGENT_CHECK", true); define("DisableEventsCheck", true); require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php"); ?> <? $password = "@Qwertyuiop22"; $filter = array( '!GROUPS_ID' => array(1), ); $elementsResult = CUser::GetList(($by="ID"), ($order="DESC"), $filter); while ($rsUser = $elementsResult->Fetch()) { $isAdmin = false; pre0( $rsUser ); $arGroups = CUser::GetUserGroup($rsUser["ID"]); // echo "<pre>"; print_r($arGroups); echo "</pre>"; foreach ($arGroups as $g_id){ if($g_id == 1) $isAdmin = true; } if($isAdmin) echo "Password not changed for: " . $rsUser["ID"] . " reason: ADMIN <br>"; else{ $oUser = new CUser; $aFields = array( 'PASSWORD' => $password ); // $oUser->Update($rsUser["ID"], $aFields); echo "Password was changed for: " . $rsUser["ID"] . "<br>"; } } ?> <? function pre0($arResult){ echo "<pre>"; print_r($arResult); echo "</pre>"; } ?> done. <? require_once($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/epilog_after.php"); ?>