ini_cron), strtotime(date("H:i")), strtotime($CFG->fin_cron))) { throw new Exception(get_string('str_fora_rang', 'block_clickedu'), 2); } $Licences = WS_Login(); add_to_log_click("cronclickedu", "Ini CRON WSClickedu ".$CFG->ws_school); //--Ini Users if(!$ws_users = WS_getUsers($Licences, '')) { throw new Exception("WS_getUsers ".get_string('wsnull_results', 'block_clickedu'), 2); } $rs = sync_users($ws_users); add_to_log_click("cronclickedu", "getUsers OK ".result_tostring($rs, true)); //--End //--Ini Users teachers Courses if(!$ws_teachers = WS_getUsersCourse($Licences)) { throw new Exception("WS_getUsersCourse ".get_string('wsnull_results', 'block_clickedu'), 2); } sync_teachers_course($Licences, $ws_teachers, true, 'cronclickedu'); //- End add_to_log_click("cronclickedu", "End CRON WSClickedu - OK"); build_context_path(); } catch(Exception $e) { add_to_log_click(basename($e->getFile()), "Line: ".$e->getLine()." Exception: ".$e->getMessage()); add_to_log_click("cronclickedu", "End CRON WSClickedu - KO"); return; } ?>