| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 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@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 |
|
|---|