root/trunk/dotnode-error.php

Revision 16, 4.6 kB (checked in by alexx, 3 years ago)
  • cleanup crapy code in dotnode-xml.php
  • include new Smarty_dotnode object to fix #14
  • modify reset_data.sh bash script to fix log problem
  • remove hardcoded ini_set error_log in config (it must bi fixed in vhost, or if not possible: in config_server.inc.php
  • fix impossibility to change language in dotpage (cookie name not set correctly)
Line 
1 <?php
2 /****************************************************** Open .node ***
3  * Description:   
4  * Status:        Stable.
5  * Author:        Alexandre Dath <alexandre@dotnode.com>
6  * $Id$
7  *
8  * Copyright (C) 2005 Alexandre Dath <alexandre@dotnode.com>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23  ******************** http://opensource.ikse.net/projects/dotnode ***/
24
25 include('../includes/includes.inc.php');
26 include('../includes/config/global.inc.php');
27
28 $smarty = new Smarty_dotnode;
29
30 $token = retreive_url_info($_SERVER['PHP_SELF']);
31
32 session_start();
33
34 switch($token[1])
35 {
36 case 'insert_user':
37     $title = "Probleme d'insertion en base :/";
38     $error_msg = "J'ai été prévenu par email et je vais essayer de corriger ca le plus vite possible.<br />Au cas ou, contactez moi sur nyrk&#64;dotnode.com";
39     break;
40 case 'image':
41     switch($token[2])
42     {
43     case 'nothing':
44         $title = _('No image sent');
45         $error_msg = _('No image found in your request');
46         break;
47     case 'notfound':
48         $title = _('Impossible to create image');
49         $error_msg = _('Impossible to manipulate image to create thumbnail');
50         break;
51     case 'bad_format':
52         $title = _('Bad image format');
53                 $error_msg = _('The format of sent image is not suppoted by .node, only JPEG, PNG and GIF please');
54         break;
55     }
56     break;
57
58 case 'no_login':
59      $title = _("Login/password invalid");
60     $error_msg = _("Please verify your Login/password.<br />\nIf you have forgot your password, you can retrieve it <a href='/error/forgot_password'>here</a>");
61     break;
62
63 case 'forgot_password':     
64 case 'wrong_login':
65     $title = _("Password retrieval");
66     
67     $send_str = _('Send');
68     $enter_your_str = _('Enter your');
69     $error_msg = '<h2>'._('Password forgotten').' ?</h2>';
70     $error_msg.= _('Fill this form to retrieve your password or your login to .node').'.';
71     $error_msg.= <<<___END___
72 <form action='/action/sendpassword' method='post'>
73 <label for='param'>$enter_your_str </label><select name='type'><option value='email'>email</option><option value='login'>login</option></select>: <input type='text' name='param' id='param' />
74 <input type='submit' value='$send_str' />
75 </form>
76 ___END___;
77     if($token[2] == 'success')
78         $error_msg.= '<span class="label">'._('You will receive an email in 2 minutes max.').'</span>';
79     break;
80
81 case 'bad_id':   
82     $title = _("Bad ID");
83     $error_msg = _("Incorrect ID");
84     break;
85 case 'bad_form':
86     $title = _('Bad Form');
87     $error_msg = _('You have en arror in the filled form');
88     break;
89
90 case 'bad_invitation':
91     $title = _('Bad invitation');
92     $error_msg = _('That invitation link is not valid');
93     break;
94 case 'bad_link':
95 case 'bad_link1':
96 case 'bad_link2':
97 case 'bad_link3':
98     $title = _('Bad link');
99     $error_msg = _('The link you have used is not valid');
100     break;
101
102 case 'bad_message':
103     $title = _('Bad message');
104     $error_msg = _('Your message is not correct');
105     break;
106
107 case 'bad_new_password':
108     $title = _('Bad new password');
109     $error_msg = _('Your new password is not valid');
110     break;
111
112 case 'not_in_community':
113     $title = _('Not in community');
114     $error_msg = _('You must be in this community to do that');
115     break;
116 case 'unknown_user':
117     $title = _('Unknown user');
118     $error_msg = _('Unknown user, or user invalid');
119     break;
120
121 case 'bad_pix_code':
122     $title = _('Verification code failed');
123     $error_msg = _("The sent code don't match the image");
124     break;
125
126 default:
127     $title = _("Unknown error");
128     error_log('ERROR: '.$_SERVER['PHP_SELF']);
129     $error_msg = _("An unknown error arose ... contact me to debug this.<br />\nThanks.");
130 }
131
132 if($_SESSION['my_id'])
133     $_SMARTY['menu'] = $menu['main'];
134 else
135     $_SMARTY['menu'] = $menu['pub'];
136
137 $_SMARTY['token'] = $token;
138 $_SMARTY['Title'] = $title;
139 $_SMARTY['errorMsg'] = $error_msg;
140 $_SMARTY['tpl'] = 'error.tpl';
141
142 if($_SERVER['REMOTE_ADDR'] == $config['admin_ip'])
143 {
144         $debug['session'] = $_SESSION;
145     $_SMARTY['debug'] = $debug;
146     $_SMARTY['lang'] = $lang;
147     $_SMARTY['php_mem'] = memory_get_usage()/1024;
148     $_SMARTY['inc'] = $inc;
149 }
150
151 $smarty->assign($_SMARTY);
152
153 header('Content-type: text/html; charset=UTF-8');
154
155 $smarty->display('index.tpl');
156
157 ?>
158
Note: See TracBrowser for help on using the browser.