query($user_query); if (handleError($user_res)) { $users = array(); while ($user_res->fetchInto($user_row)) { //check if the extension is in the sip.conf file if(isset($SIPconf[$user_row['user_phone']])&&!empty($SIPconf[$user_row['user_phone']])) { //found user in config file unset($SIPconf[$user_row['user_phone']]); } } } if($SIPconf!=false&&!empty($SIPconf)) { require_once ADMIN_PATH.'setup_users_bulk.php'; if(setup_users_array(&$LUA,$SIPconf,$debug)) { return "Import Process Completed Successfully"; } else { return "An error occurred during user setup!"; } } else { return "All users have already been imported."; } } // {{{ further initialisation $debug = $ini['System']['debug']; $form = new HTML_QuickForm(); // }}} if($LU->checkRight(ADMIN)) { $tpl->setTPL('user_import.tpl.html'); if(file_exists($ini['Asterisk']['conf_path'].$ini['Asterisk']['conf_filename'])) { $tpl->assign('foundFile',true); } //{{{ create quickform elements $form->addElement('header','hdrTop','Asterisk User Import'); $form->addElement('submit','btnSubmit','Import Users'); //}}} if ($form->validate()) { $result = $form->process('process_data',true); $tpl->assign('txtResult',$result); } else { } $tpl->display($form); } else { $tpl->setTPL('access_denied.tpl.html'); } ?>