אימות דו שלבי החדש קוד הקדמה ועוד
-
בעקבות שימות המשיח עדכנו אותנו שמי תחילת החודש כדי להתחבר למערכות יצטרכו לעבור אימות דו שלבי ובצדק פריצה למערכות וכו' ראיתי שיש גם תלונות על כך אבל הכלבים נובחים והרכבת ממשיכה ובצדק ראיתי שיסתבכו בקטע של האימות דו שלבי ב API אז לפניכם קודם כל קוד להתחברות למערכת דרך הטלפון אם אימות דו שלבי
<?php define('INI_FILE', 'DID_Storage.ini'); define('TEMP_INI_FILE_SUFFIX', ' himut.ini'); define('API_URL', 'https://www.call2all.co.il/ym/api/'); $did = $_GET['did'] ?? null; $pass = $_GET['pass'] ?? null; $ApiExtension = $_GET['ApiExtension'] ?? null; $sug_himut = $_GET['sug_himut'] ?? null; $kod_himut = $_GET['kod_himut'] ?? null; $condition = $_GET['condition'] ?? null; $hangup = $_GET['hangup'] ?? null; $token = "token=" . $did . ":" . $pass; $temp_ini_file_name = $did . TEMP_INI_FILE_SUFFIX; if ($hangup === "yes" && $did !== null) { if (file_exists($temp_ini_file_name)) { unlink($temp_ini_file_name); } exit; } if ($did === null) { echo "read=m-2571=did,yes,10,9,10,Digits,yes&"; exit; } if ($pass === null) { echo "read=m-1800=pass,yes,,,10,Digits,yes"; exit; } $ini_OK = []; if (file_exists($temp_ini_file_name)) { $ini_OK = parse_ini_file($temp_ini_file_name, true, INI_SCANNER_RAW) ?? []; } $himut_ok = ($ini_OK[$did] ?? null) === "ok" ? "ok" : null; function save_ini_file(array $data) { $content = ""; foreach ($data as $did_key => $details) { if (is_array($details) && isset($details['expiry_date'])) { $content .= "[$did_key]\n"; $content .= "expiry_date = \"" . $details['expiry_date'] . "\"\n\n"; } } return file_put_contents(INI_FILE, $content, LOCK_EX) !== false; } function set_did_in_ini(string $did_value, int $condition_value): ?bool { $ini_data = file_exists(INI_FILE) ? parse_ini_file(INI_FILE, true) : []; if ($condition_value === 3) { if (isset($ini_data[$did_value])) { unset($ini_data[$did_value]); return save_ini_file($ini_data); } return true; } $expiry_datetime = new DateTime(); if ($condition_value === 1) { $expiry_datetime->modify('+30 days'); } elseif ($condition_value === 2) { $expiry_datetime->modify('+10 years'); } else { return null; } $ini_data[$did_value] = [ 'expiry_date' => $expiry_datetime->format('Y-m-d H:i:s') ]; return save_ini_file($ini_data); } function check_did_validity(string $did): bool { if (!file_exists(INI_FILE)) { return false; } $ini_data = parse_ini_file(INI_FILE, true); if (!isset($ini_data[$did]['expiry_date'])) { return false; } $expiry_date_str = $ini_data[$did]['expiry_date']; try { $expiry_datetime = new DateTime($expiry_date_str); $current_datetime = new DateTime(); if ($expiry_datetime > $current_datetime) { return true; } else { unset($ini_data[$did]); save_ini_file($ini_data); return false; } } catch (Exception $e) { return false; } } function getMFAMethods(string $did, string $token) { $str = @file_get_contents(API_URL . "MFASession?$token&action=getMFAMethods"); $str_decoded = json_decode($str, true); if (!isset($str_decoded["responseStatus"]) || $str_decoded["responseStatus"] !== "OK") { echo "id_list_message=t-שגיאה! לא ניתן לבצע כעת את הפעולה!&go_to_folder=hangup"; exit; } elseif (($str_decoded["isAvailable"] ?? true) === false) { echo "id_list_message=t-שגיאה! לא ניתן לבצע אימות למערכת שבחרתם!&go_to_folder=hangup"; exit; } else { $dibur = ""; foreach ($str_decoded["mfaMethods"] as $task) { if (($task["STATUS"] ?? null) === "ACTIVE" && in_array('CALL', ($task["SEND_TYPE"] ?? []))) { $pos = strrpos($task["VALUE"], '•'); $extension = ($pos !== false) ? substr($task["VALUE"], $pos + 1) : $task["VALUE"]; $dibur .= "למספר שמסתיים בספרות $extension הקישו " . $task['ID'] . " "; } } echo "read=t-הקש את סוג הזיהוי שברצונך לבצע איתו את האימות $dibur=sug_himut,yes,2,1,10,Digits,yes&"; exit(); } } function sendMFA(string $sug_himut, string $token) { $str = @file_get_contents(API_URL . "MFASession?$token&action=sendMFA&mfaId=$sug_himut&mfaSendType=CALL"); $str_decoded = json_decode($str, true); if (!isset($str_decoded["responseStatus"]) || $str_decoded["responseStatus"] !== "OK") { echo "id_list_message=t-שגיאה! לא ניתן לבצע כעת את הפעולה!&go_to_folder=hangup"; exit; } else { echo "read=t-הקש את קוד האימות שנשלח אליך כעת בצורה שבחרת=kod_himut,yes,10,4,10,Digits,yes&"; exit(); } } function validMFA(string $did, string $kod_himut, string $token, string $condition, string $temp_ini_file_name) { $mfaRememberMe = ($condition === "1" || $condition === "2") ? 'true' : 'false'; $url_valid = API_URL . "MFASession?$token&action=validMFA&mfaCode=$kod_himut"; $str = @file_get_contents($url_valid); $str_decoded = json_decode($str, true); if (($str_decoded["mfa_valid_status"] ?? null) !== "VALID") { echo "id_list_message=t-שגיאה! הקוד שהוקש לא תקין!&go_to_folder=hangup"; exit; } else { file_put_contents($temp_ini_file_name, "\n$did=ok", FILE_APPEND | LOCK_EX); if ($condition === "2") { $ip_address = '64.62.151.106'; $str_ip = @file_get_contents(API_URL . "MFASession?$token&action=setMFATrustIps&trustIps=$ip_address"); $str_ip_decoded = json_decode($str_ip, true); if (($str_ip_decoded["save"] ?? false) !== true) { $condition = "3"; } } set_did_in_ini($did, (int)$condition); echo "id_list_message=t-האימות בוצע בהצלחה!&go_to_folder=/"; exit; } } function try_ymot(string $did, string $token, ?string $condition) { $str = @file_get_contents(API_URL . "MFASession?$token&action=try"); $str_decoded = json_decode($str, true); if (!isset($str_decoded["responseStatus"]) || $str_decoded["responseStatus"] !== "OK") { echo "id_list_message=t-שגיאה! לא ניתן לבצע כעת את הפעולה!&go_to_folder=hangup"; exit; } elseif (($str_decoded["isAvailable"] ?? true) === false) { echo "id_list_message=t-שגיאה! לא ניתן לבצע אימות למערכת שבחרתם!&go_to_folder=hangup"; exit; } elseif (($str_decoded["isPass"] ?? false) === false) { return false; } elseif (($str_decoded["isPass"] ?? false) === true) { return true; } return false; } function bdika(string $did, string $token, ?string $sug_himut, ?string $kod_himut, ?string $condition, string $temp_ini_file_name) { if ($kod_himut !== null) { validMFA($did, $kod_himut, $token, $condition, $temp_ini_file_name); } elseif ($sug_himut !== null) { sendMFA($sug_himut, $token); } else { getMFAMethods($did, $token); } } if ($himut_ok === "ok") { echo "id_list_message=t-האימות בוצע בהצלחה&go_to_folder=/"; exit; } $is_valid = check_did_validity($did); if ($is_valid) { $is_pass_ymot = try_ymot($did, $token, $condition); if ($is_pass_ymot === true) { file_put_contents($temp_ini_file_name, "\n$did=ok", FILE_APPEND | LOCK_EX); echo "id_list_message=t-האימות בוצע בהצלחה&go_to_folder=/"; exit; } } if ($condition !== null) { bdika($did, $token, $sug_himut, $kod_himut, $condition, $temp_ini_file_name); } if ($condition === null) { echo "read=t-הינכם מועברים לאימות דו שלבי ! אם ברצונכם שהמערכת תישמור את האימות למשך שלושים יום הקישו 1 ! אם ברצונכם שישמור לצמיתות הקישו 2 ! אם ברצונכם שלא ישמור הקישו 3=condition,yes,1,1,10,Digits,yes,,,123&"; exit; } exit;זה הקוד דוגמה של ההתחברות מכאן ניתן להמשיך אני ייתן עוד קוד דוגמה קוד מוכן למודול של הגדרת שלוחות שמשולב בה האימות דו שלבי
<?php define('INI_FILE', 'DID_Storage.ini'); define('TEMP_INI_FILE_SUFFIX', '_himut.ini'); define('API_URL', 'https://www.call2all.co.il/ym/api/'); $did = $_GET['did'] ?? null; $pass = $_GET['pass'] ?? null; $ApiExtension = $_GET['ApiExtension'] ?? null; $sug_himut = $_GET['sug_himut'] ?? null; $kod_himut = $_GET['kod_himut'] ?? null; $condition = $_GET['condition'] ?? null; $hangup = $_GET['hangup'] ?? null; $path = $_GET['path'] ?? null; $text = $_GET['text'] ?? null; $did1 = $_GET['did1'] ?? ''; $did2 = $_GET['did2'] ?? ''; $did3 = $_GET['did3'] ?? ''; $token = "token=$did:$pass"; $temp_ini_file_name = $did . TEMP_INI_FILE_SUFFIX; if ($hangup === "yes" && $did !== null) { if (file_exists($temp_ini_file_name)) { unlink($temp_ini_file_name); } exit; } if ($did === null) { echo "read=m-2571=did,yes,10,9,10,Digits,yes&"; exit; } if ($pass === null) { echo "read=m-1800=pass,yes,10,1,10,Digits,yes&"; exit; } $ini_OK = []; if (file_exists($temp_ini_file_name)) { $ini_OK = parse_ini_file($temp_ini_file_name, true, INI_SCANNER_RAW) ?? []; } $himut_ok = ($ini_OK[$did] ?? null) === "ok" ? true : false; function save_ini_file(array $data) { $content = ""; foreach ($data as $did_key => $details) { if (is_array($details) && isset($details['expiry_date'])) { $content .= "[$did_key]\nexpiry_date = \"" . $details['expiry_date'] . "\"\n\n"; } } return file_put_contents(INI_FILE, $content, LOCK_EX) !== false; } function set_did_in_ini(string $did_value, int $condition_value) { $ini_data = file_exists(INI_FILE) ? parse_ini_file(INI_FILE, true) : []; if ($condition_value === 3) { if (isset($ini_data[$did_value])) { unset($ini_data[$did_value]); save_ini_file($ini_data); } return true; } $expiry_datetime = new DateTime(); if ($condition_value === 1) $expiry_datetime->modify('+30 days'); elseif ($condition_value === 2) $expiry_datetime->modify('+10 years'); else return null; $ini_data[$did_value] = ['expiry_date' => $expiry_datetime->format('Y-m-d H:i:s')]; return save_ini_file($ini_data); } function check_did_validity(string $did): bool { if (!file_exists(INI_FILE)) return false; $ini_data = parse_ini_file(INI_FILE, true); if (!isset($ini_data[$did]['expiry_date'])) return false; try { $expiry = new DateTime($ini_data[$did]['expiry_date']); if ($expiry > new DateTime()) return true; unset($ini_data[$did]); save_ini_file($ini_data); } catch (Exception $e) {} return false; } function processConfigurationText($text, $vars) { $repl = [ '?' => '=', '!' => '&', '+-' => '#', '%2A' => '*', '?1' => $vars['did1'], '?2' => $vars['did2'], '?3' => $vars['did3'], '?did' => $vars['did'], '?pass' => $vars['pass'] ]; return strtr($text, $repl); } function translatePath($path) { if ($path == "**1") return "Star"; if ($path == "**2") return "Hash"; if ($path == "*") return ""; return $path; } if (!$himut_ok) { if (check_did_validity($did)) { $check_ym = @json_decode(file_get_contents(API_URL . "MFASession?$token&action=try"), true); if (($check_ym['isPass'] ?? false) === true) { file_put_contents($temp_ini_file_name, "[$did]\n$did=ok", FILE_APPEND); $himut_ok = true; } } } if (!$himut_ok) { if ($condition === null) { echo "read=t-נא לבחור משך שמירה. 1 ל-30 יום. 2 לצמיתות. 3 ללא שמירה=condition,yes,1,1,1,Digits,yes&"; exit; } if ($kod_himut !== null) { $res = @json_decode(file_get_contents(API_URL . "MFASession?$token&action=validMFA&mfaCode=$kod_himut"), true); if (($res["mfa_valid_status"] ?? "") === "valid") { file_put_contents($temp_ini_file_name, "[$did]\n$did=ok", FILE_APPEND); set_did_in_ini($did, (int)$condition); $himut_ok = true; } else { echo "id_list_message=t-קוד שגוי&go_to_folder=hangup&"; exit; } } elseif ($sug_himut !== null) { @file_get_contents(API_URL . "MFASession?$token&action=sendMFA&mfaId=$sug_himut&mfaSendType=CALL"); echo "read=t-נא להקיש את הקוד שקיבלתם=kod_himut,yes,6,4,10,Digits,yes&"; exit; } else { $res = @json_decode(file_get_contents(API_URL . "MFASession?$token&action=getMFAMethods"), true); if (($res['responseStatus'] ?? '') !== 'OK') { echo "id_list_message=t-שגיאה בקבלת נתונים&go_to_folder=hangup&"; exit; } $methods = ""; foreach ($res["mfaMethods"] as $m) { if ($m["STATUS"] == "ACTIVE") { $methods .= "לספרות " . substr($m["VALUE"], -2) . " הקישו " . $m["ID"] . ". "; } } echo "read=t-בחרו שיטת אימות. $methods=sug_himut,yes,2,1,2,Digits,yes&"; exit; } } if ($path === null) { echo "read=t-אנא הקישו את מספר השלוחה. לשלוחה ראשית הקישו כוכבית וסולמית=path,yes,10,1,10,Digits,yes&"; exit; } if ($text === null) { echo "read=t-הקישו את ההגדרות. סימן שאלה עבור שווה וסימן קריאה להפרדה=text,no,500,1,500,EnglishKeyboard,yes&"; exit; } $cleanPath = translatePath($path); $vars = ['did1' => $did1, 'did2' => $did2, 'did3' => $did3, 'did' => $did, 'pass' => $pass]; $additionalParams = processConfigurationText($text, $vars); $updateUrl = API_URL . "UpdateExtension?$token&path=ivr2:$cleanPath&$additionalParams"; $response = @json_decode(file_get_contents($updateUrl), true); if (($response['responseStatus'] ?? '') === "OK") { echo "id_list_message=t-הפעולה בוצעה בהצלחה&go_to_folder=/&"; } else { echo "id_list_message=t-שגיאה בעדכון&go_to_folder=hangup&"; } exit;גם אתר נחמד של ניהול מערכות
<?php session_start(); error_reporting(E_ALL); ini_set('display_errors', 1); define('API_URL', 'https://www.call2all.co.il/ym/api/'); function call_yemot($action, $params = [], $is_post = false) { global $token; if ($token) $params['token'] = $token; $url = API_URL . $action; if (!$is_post) { $url .= "?" . http_build_query($params); $res = @file_get_contents($url); } else { $options = [ 'http' => [ 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($params), ], ]; $context = stream_context_create($options); $res = @file_get_contents($url, false, $context); } return json_decode($res, true); } if (isset($_GET['logout'])) { if (isset($_SESSION['token'])) call_yemot('Logout'); session_destroy(); header("Location: " . $_SERVER['PHP_SELF']); exit; } $did = $_POST['did'] ?? $_SESSION['did'] ?? null; $pass = $_POST['pass'] ?? $_SESSION['pass'] ?? null; $token = ($did && $pass) ? "$did:$pass" : ($_SESSION['token'] ?? null); $step = 'login'; if ($token) { $_SESSION['did'] = $did; $_SESSION['pass'] = $pass; $check = call_yemot('MFASession', ['action' => 'isPass']); if ($check['responseStatus'] === 'OK' && ($check['isPass'] ?? false)) { $step = 'dashboard'; } else { $step = 'mfa'; } } $alert = ""; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action_type'])) { switch ($_POST['action_type']) { case 'set_details': $res = call_yemot('SetCustomerDetails', $_POST, true); $alert = ($res['responseStatus'] === 'OK') ? "הפרטים עודכנו בהצלחה" : "שגיאה בעדכון"; break; case 'send_sms': $res = call_yemot('SendSms', $_POST, true); $alert = "סטטוס שליחה: " . ($res['responseStatus'] ?? 'שגיאה'); break; case 'transfer_units': $res = call_yemot('TransferUnits', $_POST, true); $alert = ($res['responseStatus'] === 'OK') ? "העברה בוצעה. יתרה חדשה: " . $res['newBalance'] : "שגיאה: " . ($res['message'] ?? 'לא ידוע'); break; } } function translate_status($s) { $map = [ 'OK' => 'תקין', 'ERROR' => 'שגיאה', 'VALID' => 'מאומת', 'RUNNING' => 'פעיל כעת', 'FINISHED' => 'הסתיים', 'PAUSED' => 'מושהה', 'DELIVRD' => 'נמסר ליעד', 'EXPIRED' => 'פג תוקף' ]; return $map[$s] ?? $s; } ?> <!DOCTYPE html> <html lang="he" dir="rtl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Yemot Pro - ניהול מערכת</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.rtl.min.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css"> <style> :root { --sidebar-width: 250px; } body { background: #f8f9fa; } .sidebar { width: var(--sidebar-width); height: 100vh; position: fixed; background: #212529; color: white; padding-top: 20px; transition: 0.3s; } .main-content { margin-right: var(--sidebar-width); padding: 20px; } .nav-link { color: rgba(255,255,255,.7); margin: 5px 15px; border-radius: 8px; } .nav-link:hover, .nav-link.active { background: #0d6efd; color: white; } .card { border: none; box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075); border-radius: 12px; } .login-box { max-width: 400px; margin: 100px auto; } .file-list { cursor: pointer; } .file-list:hover { background: #e9ecef; } </style> </head> <body> <?php if ($step === 'login'): ?> <div class="login-box card p-4"> <h3 class="text-center mb-4">כניסה לניהול</h3> <form method="POST"> <div class="mb-3"><label>מספר מערכת</label><input type="text" name="did" class="form-control" required></div> <div class="mb-3"><label>סיסמה</label><input type="password" name="pass" class="form-control" required></div> <button type="submit" class="btn btn-primary w-100">התחברות</button> </form> </div> <?php elseif ($step === 'mfa'): ?> <div class="login-box card p-4"> <h3 class="text-center mb-4">אימות דו-שלבי</h3> <?php $methods = call_yemot('MFASession', ['action' => 'getMFAMethods']); if (!isset($_POST['mfa_sent'])): ?> <form method="POST"> <p>בחר שיטת קבלת קוד:</p> <?php foreach ($methods['mfaMethods'] as $m): ?> <button type="submit" name="mfa_id" value="<?= $m['ID'] ?>" class="btn btn-outline-dark w-100 mb-2 text-end"> <i class="bi bi-telephone"></i> <?= $m['VALUE'] ?> (<?= $m['NIKE'] ?>) <input type="hidden" name="mfa_sent" value="1"> </button> <?php endforeach; ?> </form> <?php else: call_yemot('MFASession', ['action' => 'sendMFA', 'mfaId' => $_POST['mfa_id'], 'mfaSendType' => 'CALL']); ?> <form method="POST"> <div class="mb-3"><label>הזן קוד שהתקבל בשיחה</label><input type="text" name="mfa_code" class="form-control text-center" required></div> <button type="submit" class="btn btn-success w-100">אישור קוד</button> </form> <?php endif; ?> </div> <?php else: ?> <div class="sidebar"> <div class="text-center mb-4"><h5>YEMOT PRO</h5></div> <nav class="nav flex-column" id="mainTabs" role="tablist"> <a class="nav-link active" data-bs-toggle="tab" href="#home"><i class="bi bi-speedometer2"></i> דאשבורד</a> <a class="nav-link" data-bs-toggle="tab" href="#account"><i class="bi bi-person-gear"></i> פרטי חשבון</a> <a class="nav-link" data-bs-toggle="tab" href="#files"><i class="bi bi-folder2-open"></i> סייר קבצים</a> <a class="nav-link" data-bs-toggle="tab" href="#sms"><i class="bi bi-chat-dots"></i> SMS</a> <a class="nav-link" data-bs-toggle="tab" href="#sip"><i class="bi bi-phone-vibrate"></i> SIP ותורים</a> <a class="nav-link" data-bs-toggle="tab" href="#campaigns"><i class="bi bi-megaphone"></i> קמפיינים</a> <a class="nav-link" data-bs-toggle="tab" href="#tasks"><i class="bi bi-calendar-check"></i> משימות</a> <a class="nav-link" data-bs-toggle="tab" href="#security"><i class="bi bi-shield-lock"></i> אבטחה</a> <a class="nav-link" data-bs-toggle="tab" href="#units"><i class="bi bi-coin"></i> יחידות</a> <hr> <a class="nav-link text-danger" href="?logout=1"><i class="bi bi-box-arrow-right"></i> התנתקות</a> </nav> </div> <div class="main-content"> <?php if ($alert): ?><div class="alert alert-info alert-dismissible fade show"><?= $alert ?><button type="button" class="btn-close" data-bs-dismiss="alert"></button></div><?php endif; ?> <div class="tab-content"> <div class="tab-pane fade show active" id="home"> <div class="row"> <?php $cust = call_yemot('GetCustomerData'); $sess = call_yemot('GetSession'); ?> <div class="col-md-4"> <div class="card p-3 bg-primary text-white"> <h6>יתרת יחידות</h6> <h2><?= number_format($sess['units'], 2) ?></h2> <small>פג תוקף: <?= $sess['unitsExpireDate'] ?></small> </div> </div> <div class="col-md-4"> <div class="card p-3"> <h6>מספר מערכת ראשי</h6> <h4><?= $cust['mainDid'] ?></h4> <small>סוג: <?= translate_status($cust['ivrType']) ?></small> </div> </div> <div class="col-md-4"> <div class="card p-3"> <h6>סטטוס אימות</h6> <h4 class="text-success"><i class="bi bi-patch-check"></i> מאומת</h4> <small>IP: <?= $_SERVER['REMOTE_ADDR'] ?></small> </div> </div> </div> <div class="row mt-4"> <div class="col-md-6"> <div class="card p-3"> <h5><i class="bi bi-info-circle"></i> מידע לקוח</h5> <table class="table table-sm"> <tr><td>שם:</td><td><?= $sess['name'] ?></td></tr> <tr><td>אימייל:</td><td><?= $sess['email'] ?></td></tr> <tr><td>ארגון:</td><td><?= $sess['organization'] ?></td></tr> </table> </div> </div> <div class="col-md-6"> <div class="card p-3"> <h5><i class="bi bi-telephone-plus"></i> מספרים משניים</h5> <div style="max-height: 150px; overflow-y: auto;"> <?php foreach (($cust['secondary_dids'] ?? []) as $sd): ?> <div class="d-flex justify-content-between border-bottom py-1"> <span><?= $sd['did'] ?></span> <span class="badge bg-secondary"><?= $sd['usage'] ?></span> </div> <?php endforeach; ?> </div> </div> </div> </div> </div> <div class="tab-pane fade" id="account"> <div class="card p-4"> <h5>עדכון פרטי משתמש</h5> <form method="POST"> <input type="hidden" name="action_type" value="set_details"> <div class="row"> <div class="col-md-6 mb-3"><label>שם לקוח</label><input type="text" name="name" class="form-control" value="<?= $sess['name'] ?>"></div> <div class="col-md-6 mb-3"><label>אימייל</label><input type="email" name="email" class="form-control" value="<?= $sess['email'] ?>"></div> <div class="col-md-6 mb-3"><label>ארגון</label><input type="text" name="organization" class="form-control" value="<?= $sess['organization'] ?>"></div> <div class="col-md-6 mb-3"><label>טלפונים</label><input type="text" name="phones" class="form-control" value="<?= $sess['phones'] ?>"></div> <div class="col-md-6 mb-3"><label>סיסמת גישה</label><input type="text" name="accessPassword" class="form-control" value="<?= $sess['accessPassword'] ?>"></div> <div class="col-md-6 mb-3"><label>סיסמת הקלטות</label><input type="text" name="recordPassword" class="form-control" value="<?= $sess['recordPassword'] ?>"></div> </div> <button type="submit" class="btn btn-primary">שמור שינויים</button> </form> </div> </div> <div class="tab-pane fade" id="files"> <div class="card p-3"> <div class="d-flex justify-content-between mb-3"> <h5>סייר קבצים - שלוחה ראשית</h5> <button class="btn btn-sm btn-outline-primary"><i class="bi bi-upload"></i> העלאת קובץ</button> </div> <?php $files = call_yemot('GetIVR2Dir', ['path' => '/']); ?> <div class="list-group"> <?php foreach (($files['dirs'] ?? []) as $d): ?> <div class="list-group-item file-list d-flex justify-content-between"> <span><i class="bi bi-folder-fill text-warning"></i> <?= $d['name'] ?></span> <small><?= $d['extType'] ?></small> </div> <?php endforeach; ?> <?php foreach (($files['files'] ?? []) as $f): ?> <div class="list-group-item file-list d-flex justify-content-between"> <span><i class="bi bi-file-earmark-music"></i> <?= $f['name'] ?></span> <div> <button class="btn btn-sm"><i class="bi bi-download"></i></button> <button class="btn btn-sm text-danger"><i class="bi bi-trash"></i></button> </div> </div> <?php endforeach; ?> </div> </div> </div> <div class="tab-pane fade" id="sms"> <div class="row"> <div class="col-md-4"> <div class="card p-3"> <h5>שליחת SMS</h5> <form method="POST"> <input type="hidden" name="action_type" value="send_sms"> <div class="mb-2"><label>מספרי יעד (מופרדים ב-:)</label><input type="text" name="phones" class="form-control"></div> <div class="mb-2"><label>תוכן ההודעה</label><textarea name="message" class="form-control" rows="3"></textarea></div> <button type="submit" class="btn btn-primary w-100">שלח כעת</button> </form> </div> </div> <div class="col-md-8"> <div class="card p-3"> <h5>הודעות נכנסות</h5> <?php $inSms = call_yemot('GetIncomingSms', ['limit' => 10]); ?> <table class="table table-hover table-sm"> <thead><tr><th>מאת</th><th>תוכן</th><th>תאריך</th></tr></thead> <tbody> <?php foreach (($inSms['rows'] ?? []) as $s): ?> <tr><td><?= $s['source'] ?></td><td><?= $s['message'] ?></td><td><?= $s['receive_date'] ?></td></tr> <?php endforeach; ?> </tbody> </table> </div> </div> </div> </div> <div class="tab-pane fade" id="units"> <div class="row"> <div class="col-md-8"> <div class="card p-3"> <h5>תנועות אחרונות</h5> <?php $trans = call_yemot('GetTransactions', ['limit' => 10]); ?> <table class="table table-sm"> <thead><tr><th>זמן</th><th>תיאור</th><th>כמות</th><th>יתרה</th></tr></thead> <tbody> <?php foreach (($trans['transactions'] ?? []) as $t): ?> <tr> <td><?= $t['transactionTime'] ?></td> <td><?= $t['description'] ?></td> <td class="<?= $t['amount'] < 0 ? 'text-danger' : 'text-success' ?>"><?= $t['amount'] ?></td> <td><?= $t['newBalance'] ?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> </div> <div class="col-md-4"> <div class="card p-3"> <h5>העברת יחידות</h5> <form method="POST"> <input type="hidden" name="action_type" value="transfer_units"> <div class="mb-2"><label>מערכת יעד</label><input type="text" name="destination" class="form-control"></div> <div class="mb-2"><label>כמות יחידות</label><input type="number" name="amount" class="form-control"></div> <button type="submit" class="btn btn-warning w-100">בצע העברה</button> </form> </div> </div> </div> </div> <div class="tab-pane fade" id="sip"> <div class="card p-3"><h5>חשבונות SIP וניהול תורים</h5><p>טעינת נתונים...</p></div> </div> <div class="tab-pane fade" id="campaigns"> <div class="card p-3"><h5>ניהול קמפיינים</h5><p>טעינת נתונים...</p></div> </div> <div class="tab-pane fade" id="tasks"> <div class="card p-3"><h5>תזמון משימות</h5><p>טעינת נתונים...</p></div> </div> <div class="tab-pane fade" id="security"> <div class="card p-3"><h5>אבטחה ולוגים</h5><p>טעינת נתונים...</p></div> </div> </div> </div> <?php endif; ?> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> </body> </html>ניתן להגיב על כל בעיה בקוד הערות
תודה ל @ימות-המשיח ול @שלוימי-770 ועל כל העוסקים במלאכה על שדרוג האבטחה במערכות ועל כל מ שעשו מי קום החברה עד רגע זה ותודה ענקית לבורא עולם