source: trunk/admin/inc/ckeditor/filemanager/check_con_spiegazioni.php@ 364

Last change on this file since 364 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.7 KB
Line 
1<?php
2function check_admin() {
3@require_once("../../../../config.php");
4 $link = @mysql_connect($dbhost, $dbuname, $dbpass);
5 if (!$link)
6 {
7 echo "Non può essere effettuata la connessione a MySQL.<br />";
8 echo "Errore di MySQL: (" . mysql_errno() . ") " . mysql_error() . " \n";
9 die("<br />MANUTENZIONE");
10 }
11if(isset($HTTP_COOKIE_VARS)) {
12 $_COOKIE = $HTTP_COOKIE_VARS;
13 }
14$admin = $_COOKIE['admin'];
15
16if (!$admin) { echo "NON PRESENTE"; }
17if (!$admin) { return 0; }
18
19static $adminSave;
20
21if (isset($adminSave)) return $adminSave;
22$admin = base64_decode($admin);
23$admin = addslashes($admin);
24$admin = explode(':', $admin);
25
26$aid = $admin[0];
27$pwd = $admin[1];
28$site_id = $admin[3];
29
30
31//echo "- cookie";
32//echo "<br />- ".$aid;
33//echo "<br />- ".$pwd;
34//echo "<br />- ".$site_id;
35
36
37static $adminSave;
38if (isset($adminSave)) return $adminSave;
39$aid = substr(addslashes($aid), 0, 25);
40if (!empty($aid) && !empty($pwd)) {
41if (empty($siteid) OR ($siteid <'1')) $siteid='1';
42
43
44 $query = "SELECT pwd, site_id FROM {$dbname}.{$prefix}_authors WHERE aid='$aid'";
45 $result = mysql_query($query, $link);
46 if (!$result)
47 {
48 echo " Errore di MySQL: (" . mysql_errno() . ") " . mysql_error() . " \n";
49 exit();
50 }
51
52$pass = mysql_fetch_row($result);
53mysql_free_result($result);
54//echo "<br />Database";
55//echo "<br />".$pass[0];
56//echo "<br />".$pass[1];
57
58
59if ((($pass[0] == $pwd && !empty($pass[0])) AND ($pass[1] == $siteid && !empty($pass[1])))) {
60
61 //echo "<br />1".$adminSave;
62 return $adminSave = 1;
63 } else {
64
65
66
67 //echo "<br />0".$adminSave;
68 return $adminSave = 0;
69 }
70}
71}
72
73check_admin();
74?>
Note: See TracBrowser for help on using the repository browser.