source: trunk/admin/inc/ckeditor/filemanager/check.php@ 239

Last change on this file since 239 was 239, checked in by luc, 9 years ago

Admin: correzione visulaizzazione immissione dati spoglio per Chrome e Safari - Aggiornamento dell'editor da FCKeditor a CKeditor , accessibili anche a Chrome e Safari.

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1<?php
2
3##############################################
4# WL-CMS inclusion #
5# adapted to Accessbile Portal #
6# ================= #
7# Copyright (c) 2010 by Weblord #
8# http://www.weblord.it #
9# http://www.webelite.it #
10# http://www.portaleacccessibile.com #
11##############################################
12
13if (!defined('FILEMANAGER_FILE')) {
14 die("Non puoi accedere direttamente a questo file...");
15}
16error_reporting(E_ALL ^ E_NOTICE);
17function check_admin() {
18@require_once("../../../../config.php");
19@require_once("db.class.php");
20$db=new DBConnection($dbhost,$dbuname,$dbpass,$dbname);
21
22if(isset($HTTP_COOKIE_VARS)) {
23 $_COOKIE = $HTTP_COOKIE_VARS;
24 }
25$admin = $_COOKIE['admin'];
26
27if (!$admin) { return 0; }
28$adminSave = 0;
29static $adminSave;
30if (isset($adminSave)) return $adminSave;
31$admin = base64_decode($admin);
32$admin = addslashes($admin);
33$admin = explode(':', $admin);
34
35$aid = $admin[0];
36$pwd = $admin[1];
37$site_id = $admin[3];
38
39$aid = substr(addslashes($aid), 0, 25);
40if (!empty($aid) && !empty($pwd)) {
41
42 $query = "SELECT pwd, site_id FROM ".$prefix."_authors WHERE aid='$aid'";
43 $res=$db->rq($query);
44 if (!$res)
45 {
46 echo " Errore di MySQL: (" . mysql_errno() . ") " . mysql_error() . " \n";
47 exit();
48 }
49
50$pass=$db->afetch($res);
51$db->free_result($res);
52
53if ((($pass[0] == $pwd && !empty($pass[0])) AND ($pass[1] == $site_id && !empty($pass[1])))) {
54 return $adminSave = 1;
55 } else {
56 return $adminSave = 0;
57 }
58}
59}
60
61?>
Note: See TracBrowser for help on using the repository browser.