Subversion-Projekte lars-tiefland.content-management

Revision

Revision 1 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1 Revision 2
Zeile 1... Zeile 1...
1
<?
1
<?php
-
 
2
    $path = "module/content-management/";
2
        function microtime_float()
3
    if ( !defined( "IS_WEBAN" ) )
-
 
4
    {
-
 
5
        if ( $_SERVER["REMOTE_ADDR"] == "89.245.130.99" || $_SERVER["PHP_AUTH_USER"] ==
-
 
6
            "admin" || preg_match( "/192\.168\.0/", $_SERVER["REMOTE_ADDR"] ) )
3
        {
7
        {
4
           list($usec, $sec) = explode(" ", microtime());
-
 
5
           return ((float)$usec + (float)$sec);
8
            define( "IS_WEBAN", true );
6
        }
9
        }
-
 
10
        else
-
 
11
        {
-
 
12
            define( "IS_WEBAN", false );
-
 
13
        }
-
 
14
    }
-
 
15
    function microtime_float()
-
 
16
    {
-
 
17
        list( $usec, $sec ) = explode( " ", microtime() );
-
 
18
        return ( ( float )$usec + ( float )$sec );
-
 
19
    }
-
 
20
 
-
 
21
    define( "DEBUG", true );
Zeile 7... Zeile -...
7
 
-
 
8
        define("DEBUG",true);
-
 
9
        
22
 
10
$self=basename($_SERVER["PHP_SELF"]);
23
    $self = basename( $_SERVER["PHP_SELF"] );
11
$MySQL_Host="localhost";
24
    $MySQL_Host = "localhost";
12
$database_name="content_management";
25
    $database_name = "content_management";
13
 
26
 
14
if ( $_SERVER["SERVER_NAME"] != "server2" )
27
    if ( $_SERVER["SERVER_NAME"] != "server2" )
15
{
28
    {
16
    $MySQL_User = "content_managem";
29
        $MySQL_User = "content_managem";
17
    $MySQL_Passwd = "k-dp-u";
30
        $MySQL_Passwd = "k-dp-u";
18
}
31
    }
Zeile 130... Zeile 166...
130
	}
166
    }
131
 
167
 
132
    function getUserName()
168
    function getUserName()
133
    {
169
    {
134
        global $localhost_dbh;
170
        global $localhost_dbh;
135
        $sql="
171
        $sql = "
136
            SELECT
172
            SELECT
137
                name
173
                name
138
            FROm
174
            FROm
139
                content_management.Access
175
                content_management.Access
140
            WHERE
176
            WHERE
141
                user='".$_SERVER["PHP_AUTH_USER"]."'
177
                user='" . $_SERVER["PHP_AUTH_USER"] . "'
142
        ";       
178
        ";
143
        $res=mysql_query($sql, $localhost_dbh);
179
        $res = mysql_query( $sql, $localhost_dbh );
144
        if($res)
180
        if ( $res )
145
        {
181
        {
146
            $row=mysql_fetch_assoc($res);
182
            $row = mysql_fetch_assoc( $res );
147
            if(!empty($row["name"]))
183
            if ( !empty( $row["name"] ) )
148
            {
184
            {
149
                $ret=$row["name"];
185
                $ret = $row["name"];
150
            }
186
            }
151
            else
187
            else
152
            {
188
            {
153
                $ret=$_SERVER["PHP_AUTH_USER"];
189
                $ret = $_SERVER["PHP_AUTH_USER"];
154
            }
190
            }
155
        }
191
        }
156
        else
192
        else
157
        {
193
        {
158
            $ret=$_SERVER["PHP_AUTH_USER"];
194
            $ret = $_SERVER["PHP_AUTH_USER"];
159
        }
195
        }
160
        return $ret;
196
        return $ret;
161
    }
197
    }
-
 
198
    $_SESSION["USERNAME"] = getUserName();
162
    $_SESSION["USERNAME"]=getUserName();
199
    //require_once "/web/apache/content-management/loginTest.php";
163
	//require_once "../loginTest.php";
200