function read_auth($page, $auth_flag = true, $exit_flag = true) { global $read_auth, $read_auth_pages, $_title_cannotread; return $read_auth ? basic_auth($page, $auth_flag, $exit_flag, $read_auth_pages, $_title_cannotread) : true; }
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * ----------------------------------------------------------------------------- */ require_once 'ajax.php'; require_once "NRG/Configuration.php"; require_once "NRG/Login/Google/ClientLogin.php"; /* basic auth ? */ if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { $config = new \NRG\Configuration("../config.ini.php"); basic_auth($config->Setup); } else { /* regular auth */ if (!isset($_SESSION['auth']) || !$_SESSION['auth']) { $result = array("success" => 0, "message" => "We're really sorry, but you've been idle for a while and your session has expired.<br><br>You will now be logged out and prompted to login again.", "action" => "refresh"); ajax_result($result); } } function setClearanceLevel($level) { //cannot currently detect clearance level for basic-auth users if (isset($_SERVER['PHP_AUTH_USER'])) { return; } if ((int) $_SESSION['clearance'] < $level) { ajax_error('You do not have sufficient permissions to perform this operation.');
function read_auth($page, $auth_flag = TRUE, $exit_flag = TRUE) { global $read_auth, $read_auth_pages, $_title_cannotread; return $read_auth ? basic_auth($page, $auth_flag, $exit_flag, $read_auth_pages, $_title_cannotread) : TRUE; }