function reloadAasterisk($smarty, $module_name, $local_templates_dir, &$pDB, $arrConf, $arrCredentiasls) { $showMsg = false; $continue = false; /*if($arrCredentiasls['userlevel']=="other"){ $smarty->assign("mb_title", _tr("ERROR")); $smarty->assign("mb_message",_tr("You are not authorized to perform this action")); }*/ $idOrganization = $arrCredentiasls['id_organization']; if ($arrCredentiasls['userlevel'] == "superadmin") { $idOrganization = getParameter("organization_id"); } if ($idOrganization == 1) { return reportUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentiasls); } $query = "select domain from organization where id=?"; $result = $pDB->getFirstRowQuery($query, false, array($idOrganization)); if ($result === false) { $smarty->assign("mb_title", _tr("ERROR")); $smarty->assign("mb_message", _tr("Asterisk can't be reloaded. ") . _tr($pDB->errMsg)); $showMsg = true; } elseif (count($result) == 0) { $smarty->assign("mb_title", _tr("ERROR")); $smarty->assign("mb_message", _tr("Asterisk can't be reloaded. ") . _tr("Invalid Organization. ")); $showMsg = true; } else { $domain = $result[0]; $continue = true; } if ($continue) { $pAstConf = new paloSantoASteriskConfig($pDB); if ($pAstConf->generateDialplan($domain) === false) { $pAstConf->setReloadDialplan($domain, true); $smarty->assign("mb_title", _tr("ERROR")); $smarty->assign("mb_message", _tr("Asterisk can't be reloaded.") . $pAstConf->errMsg); $showMsg = true; } else { $pAstConf->setReloadDialplan($domain); $smarty->assign("mb_title", _tr("MESSAGE")); $smarty->assign("mb_message", _tr("Asterisk was reloaded correctly.")); } } return reportUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf, $arrCredentiasls); }
case "moderateBans": case "moderatebans": $oldignoreuserabort = ignore_user_abort(true); moderateBans($option,$act,$uid); break; case "approveImage": case "approveimage": $oldignoreuserabort = ignore_user_abort(true); approveImage(); break; case "reportUser": case "reportuser": $oldignoreuserabort = ignore_user_abort(true); reportUser($option,$form,$uid); break; case "processReports": case "processreports": $oldignoreuserabort = ignore_user_abort(true); processReports(); break; case "banProfile": case "banprofile": $oldignoreuserabort = ignore_user_abort(true); banUser($option,$uid,$form,$act); break; case "viewReports":
$url = 'post.php?id=' . $postID . '#' . $commentID; $reportingMsg = '<p>Reporting comment <a href="' . $url . '">' . $commentID . '</a></p>'; } else { if ($userID && !$commentID) { // Reporting user $reporting = "user"; $user = getUserForID($id); $url = 'user.php?id=' . $id; $reportingMsg = '<p>Reporting user <a href="' . $url . '">' . $user['username'] . '</a></p>'; } } if ($submitted) { if ($reason) { if ($reporting === "user") { // Insert user report to db $reported = reportUser($userID, $myUserID, $reason); if ($reported['success']) { header("Location:user.php?id={$userID}"); } else { $responseMsg = $reported['response'] . "<br><br>"; } } else { if ($reporting === "comment") { // Insert comment report to db $reported = reportComment($commentID, $postID, $myUserID, $reason); if ($reported['success']) { header("Location:post.php?id={$postID}#{$commentID}"); } else { $responseMsg = $reported['response'] . "<br><br>"; } }