• R/O
  • SSH
  • HTTPS

jeanscms: Commit


Commit MetaInfo

Révision363 (tree)
l'heure2017-10-24 09:09:21
Auteurkmorimatsu

Message de Log

error -> jerror

Change Summary

Modification

--- jeanscms/branches/jeans7/jeans/libs/admin/admin_batch.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_batch.php (revision 363)
@@ -36,10 +36,10 @@
3636 switch($_POST['action']){
3737 case 'admin.batch.deletecomments':
3838 case 'admin.batch.deletemedia':
39- if (!member::logged_in()) error::quit($warning);
39+ if (!member::logged_in()) jerror::quit($warning);
4040 break;
4141 default:
42- if (!member::is_admin()) error::quit($warning);
42+ if (!member::is_admin()) jerror::quit($warning);
4343 break;
4444 }
4545 }
@@ -122,7 +122,7 @@
122122 $row=sql::query($checkquery,$id)->fetch();
123123 if ($row['result']) {
124124 $note=self::translate('_ADMIN_BATCH_ITEM_COMMENTS_EXIST');
125- error::note($note.': #<%0%>',$id);
125+ jerror::note($note.': #<%0%>',$id);
126126 continue;
127127 }
128128 }
@@ -132,7 +132,7 @@
132132 $note=self::translate('_ADMIN_BATCH_DELETEITEM');
133133 sql::query($commentquery,$id);
134134 } else $note=self::translate('_ADMIN_BATCH_DELETEITEM_FALIED');
135- error::note($note.': #<%0%>',$id);
135+ jerror::note($note.': #<%0%>',$id);
136136 sql::commit();
137137 }
138138 }
@@ -140,13 +140,13 @@
140140 // This method is placed here because this cannot be placed in admin_comments class.
141141 if (member::is_admin()) $query='DELETE FROM jeans_comment WHERE id=<%id%>';
142142 elseif (member::logged_in()) $query='DELETE FROM jeans_comment WHERE id=<%id%> AND author=<%author%>';
143- else error::quit(_ADMIN_NO_PERMISSION);
143+ else jerror::quit(_ADMIN_NO_PERMISSION);
144144 sql::begin();
145145 foreach (self::$ids as $id) {
146146 $res=sql::query($query,array('id'=>$id,'author'=>member::setting('id')));
147147 if (0<$res->rowCount()) $note=self::translate('_ADMIN_BATCH_DELETECOMMENT');
148148 else $note=self::translate('_ADMIN_BATCH_DELETECOMMENT_FALIED');
149- error::note($note.': #<%0%>',$id);
149+ jerror::note($note.': #<%0%>',$id);
150150 }
151151 sql::commit();
152152 }
@@ -159,7 +159,7 @@
159159 $res=sql::query($countquery,$id)->fetch();
160160 if ($res['result']) {
161161 $note=self::translate('_ADMIN_BATCH_GROUP_NOT_EMPTY');
162- error::note($note.': #<%0%>',$id);
162+ jerror::note($note.': #<%0%>',$id);
163163 continue;
164164 }
165165 sql::begin();
@@ -170,7 +170,7 @@
170170 $note=self::translate('_ADMIN_BATCH_DELETEGROUP');
171171 } else $note=self::translate('_ADMIN_BATCH_DELETEGROUP_FALIED');
172172 sql::commit();
173- error::note($note.': #<%0%>',$id);
173+ jerror::note($note.': #<%0%>',$id);
174174 }
175175 }
176176 static public function action_post_deleteplugins(){
@@ -191,7 +191,7 @@
191191 $note=self::translate('_ADMIN_BATCH_DELETEPLUGIN');
192192 }
193193 }
194- error::note($note.': <%0%>',$id);
194+ jerror::note($note.': <%0%>',$id);
195195 }
196196 sql::commit();
197197 $res=sql::query('SELECT id FROM jeans_plugin ORDER BY sequence ASC');
@@ -212,10 +212,10 @@
212212 }
213213 if ($_POST['direction']=='up' && count($upper)) {
214214 array_unshift($lower,array_pop($upper));
215- error::note(self::translate('_ADMIN_BATCH_MOVEPLUGINS_UP'));
215+ jerror::note(self::translate('_ADMIN_BATCH_MOVEPLUGINS_UP'));
216216 } elseif ($_POST['direction']=='down' && count($lower)) {
217217 array_push($upper,array_shift($lower));
218- error::note(self::translate('_ADMIN_BATCH_MOVEPLUGINS_DOWN'));
218+ jerror::note(self::translate('_ADMIN_BATCH_MOVEPLUGINS_DOWN'));
219219 }
220220 $query='UPDATE jeans_plugin SET sequence=<%i%> WHERE id=<%id%>';
221221 $i=0;
@@ -240,7 +240,7 @@
240240 $ids=array();
241241 while ($row=$res->fetch()) $ids[]=$row['id'];
242242 $res=sql::query('DELETE FROM jeans_binary WHERE id IN (<%ids%>)',array('ids'=>$ids));
243- if (0<$res->rowCount()) error::note('_ADMIN_BATCH_DELETEMEDIA_DONE');
244- else error::note('_ADMIN_BATCH_DELETEMEDIA_FAILED');
243+ if (0<$res->rowCount()) jerror::note('_ADMIN_BATCH_DELETEMEDIA_DONE');
244+ else jerror::note('_ADMIN_BATCH_DELETEMEDIA_FAILED');
245245 }
246246 }
\ No newline at end of file
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_comment.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_comment.php (revision 363)
@@ -10,14 +10,14 @@
1010 // if self::$itemdata remains as false, edit/add comment isn't accepted.
1111 if (!empty($_GET['cid'])) {
1212 $row=sql::query('SELECT itemid, author from jeans_comment WHERE id=<%0%>',$_GET['cid'])->fetch();
13- if (!$row) return error::fatal('_ADMIN_COMMENT_NO_SUCH_COMMENT');
14- if ($row['author']!=member::setting('id') && !member::is_admin()) return error::fatal('_ADMIN_NO_PERMISSION');
13+ if (!$row) return jerror::fatal('_ADMIN_COMMENT_NO_SUCH_COMMENT');
14+ if ($row['author']!=member::setting('id') && !member::is_admin()) return jerror::fatal('_ADMIN_NO_PERMISSION');
1515 $itemid=$row['itemid'];
1616 } elseif (!empty($_POST['itemid'])) $itemid=(int)$_POST['itemid'];
1717 elseif (!empty($_GET['itemid'])) $itemid=(int)$_GET['itemid'];
18- else return error::fatal('_ADMIN_COMMENT_NO_SUCH_ITEM');
18+ else return jerror::fatal('_ADMIN_COMMENT_NO_SUCH_ITEM');
1919 self::$itemdata=sql::query('SELECT gid,id FROM jeans_item WHERE id=<%0%>',$itemid)->fetch();
20- if (!self::$itemdata) return error::fatal('_ADMIN_COMMENT_NO_SUCH_ITEM');
20+ if (!self::$itemdata) return jerror::fatal('_ADMIN_COMMENT_NO_SUCH_ITEM');
2121 }
2222 static public function enabled(){
2323 if (!self::$itemdata) return false;
@@ -24,7 +24,7 @@
2424 return comments::if_enabled(self::$itemdata);
2525 }
2626 static public function action_post_add(){
27- if (!self::enabled()) return error::note('_ADMIN_COMMENT_NOT_ACCEPTED');
27+ if (!self::enabled()) return jerror::note('_ADMIN_COMMENT_NOT_ACCEPTED');
2828 // prepare XML
2929 $xml=new SimpleXMLElement(_XML_BLANC);
3030 if (member::logged_in()) {
@@ -32,11 +32,11 @@
3232 $xml->web= member::setting('web');
3333 $xml->email= member::setting('email');
3434 } else {
35- if (strlen($_POST['user_text'])==0) return error::note('_ADMIN_COMMENT_VALID_USER_NAME_RQUIRED');
35+ if (strlen($_POST['user_text'])==0) return jerror::note('_ADMIN_COMMENT_VALID_USER_NAME_RQUIRED');
3636 if (constant('_CONF_PROTECT_MEMBER_NAMES')) {
3737 $query='SELECT COUNT(*) as result FROM jeans_member WHERE name LIKE <%0%>';
3838 $row=sql::query($query,$_POST['user_text'])->fetch();
39- if ($row['result']) return error::note('_ADMIN_COMMENT_VALID_USER_NAME_RQUIRED');
39+ if ($row['result']) return jerror::note('_ADMIN_COMMENT_VALID_USER_NAME_RQUIRED');
4040 }
4141 $xml->user= $_POST['user_text'];
4242 $xml->web= $_POST['web_url'];
@@ -46,7 +46,7 @@
4646 $xml->time=_NOW;
4747 // prepare row
4848 $row=array('author'=>(int)member::setting('id'), 'xml'=>$xml->asXML());
49- if (empty($_POST['body_text'])) return error::note('_ADMIN_COMMENT_NO_EMPTY_COMMENT');
49+ if (empty($_POST['body_text'])) return jerror::note('_ADMIN_COMMENT_NO_EMPTY_COMMENT');
5050 else $row['body']=$_POST['body_text'];
5151 $row['itemid']=self::$itemdata['id'];
5252 // update SQL table
@@ -63,7 +63,7 @@
6363 // use $_GET['commentid'] and $_POST['body_text']
6464 if (member::is_admin()) $query='UPDATE jeans_comment SET body=<%body%>, flags=<%flags%> WHERE id=<%id%>';
6565 elseif (member::logged_in()) $query='UPDATE jeans_comment SET body=<%body%>, flags=<%flags%> WHERE id=<%id%> AND author=<%author%>';
66- else return error::fatal('_ADMIN_NO_PERMISSION');
66+ else return jerror::fatal('_ADMIN_NO_PERMISSION');
6767 // prepare data array
6868 $post=admin::item_from_post('jeans_comment');
6969 $array=array('body'=>$post['body'],'id'=>$_GET['cid'],'author'=>member::setting('id'),'flags'=>$post['flags']);
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_comments.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_comments.php (revision 363)
@@ -14,8 +14,8 @@
1414 if (!member::is_admin()) {
1515 $query='SELECT author FROM jeans_comment WHERE id=<%0%>';
1616 $row=sql::query($query,$_GET['cid'])->fetch();
17- if (!$row) error::quit($warning);
18- if ($row['author']!=member::setting('id')) error::quit($warning);
17+ if (!$row) jerror::quit($warning);
18+ if ($row['author']!=member::setting('id')) jerror::quit($warning);
1919 }
2020 self::$mode='comment';
2121 self::$id=$_GET['cid'];
@@ -24,8 +24,8 @@
2424 if (!member::is_admin()) {
2525 $query='SELECT author FROM jeans_item WHERE id=<%0%>';
2626 $row=sql::query($query,$_GET['itemid'])->fetch();
27- if (!$row) error::quit($warning);
28- if ($row['author']!=member::setting('id')) error::quit($warning);
27+ if (!$row) jerror::quit($warning);
28+ if ($row['author']!=member::setting('id')) jerror::quit($warning);
2929 }
3030 self::$mode='item';
3131 self::$id=$_GET['itemid'];
@@ -32,13 +32,13 @@
3232 } elseif (!empty($_GET['mid'])) {
3333 // Owner and superadmin can go ahead
3434 if (!member::is_admin()) {
35- if (member::setting('id')!=$_GET['mid']) error::quit($warning);
35+ if (member::setting('id')!=$_GET['mid']) jerror::quit($warning);
3636 }
3737 self::$mode='member';
3838 self::$id=$_GET['mid'];
3939 } elseif (!empty($_GET['gid'])) {
4040 // Only superadmin can go ahead
41- if (!member::is_admin()) error::quit($warning);
41+ if (!member::is_admin()) jerror::quit($warning);
4242 self::$mode='group';
4343 self::$id=$_GET['gid'];
4444 }
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_config.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_config.php (revision 363)
@@ -9,7 +9,7 @@
99 // Load the language file
1010 $warning=self::translate('_ADMIN_NO_PERMISSION');
1111 // Only superadmin can use this class
12- if (!member::is_admin()) error::quit($warning);
12+ if (!member::is_admin()) jerror::quit($warning);
1313 }
1414 static public function tag_conflist(&$data,$skin=false){
1515 static $cache;
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_group.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_group.php (revision 363)
@@ -9,7 +9,7 @@
99 // Load the language file
1010 $warning=self::translate('_ADMIN_NO_PERMISSION');
1111 // Only superadmin can use this class
12- if (!member::is_admin()) error::quit($warning);
12+ if (!member::is_admin()) jerror::quit($warning);
1313 }
1414 static private function _groupsetting($data,$skin,$type){
1515 static $cache=array();
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_item.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_item.php (revision 363)
@@ -9,7 +9,7 @@
99 // Load the language file
1010 $warning=self::translate('_ADMIN_NO_PERMISSION');
1111 // Only superadmin can use this class
12- if (!member::is_admin()) error::quit($warning);
12+ if (!member::is_admin()) jerror::quit($warning);
1313 }
1414 static public function tag_edititemform(&$data,$skin=false){
1515 // TODO: support using extended values defined by plugin as XML values.
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_log.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_log.php (revision 363)
@@ -9,7 +9,7 @@
99 // Load the language file
1010 $warning=self::translate('_ADMIN_NO_PERMISSION');
1111 // Only superadmin can use this class
12- if (!member::is_admin()) error::quit($warning);
12+ if (!member::is_admin()) jerror::quit($warning);
1313 }
1414 static public function tag_list(&$data,$skin=false,$limit=100){
1515 $offset=isset($_GET['offset'])?(int)$_GET['offset']:0;
@@ -35,13 +35,13 @@
3535 }
3636 static public function action_post_delete(){
3737 sql::query('DELETE FROM jeans_log');
38- error::note('_ADMIN_LOG_DELETED');
38+ jerror::note('_ADMIN_LOG_DELETED');
3939 if (!empty($_POST['vacuum'])) {
4040 foreach (sql::pdo_objects() as $mode=>$pdo) {
4141 sql::select_pdo($mode);
4242 sql::query('VACUUM;');
4343 }
44- error::note('_ADMIN_VACUUM_DONE');
44+ jerror::note('_ADMIN_VACUUM_DONE');
4545 }
4646 }
4747 }
\ No newline at end of file
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_mail.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_mail.php (revision 363)
@@ -15,7 +15,7 @@
1515 case 'admin.mail.reactivate':
1616 break;
1717 default:
18- error::quit($warning);
18+ jerror::quit($warning);
1919 }
2020 }
2121 // Reactivation keys are valid for 2 days.
@@ -80,7 +80,7 @@
8080 $text.=self::translate('_ADMIN_MAIL_REACTIVATE_ACCOUNT_TEXT2')."\n";
8181 $text.=_CONF_URL_ADMIN.'?mid='.$id.'&reactivate='.$key."\n";
8282 // Send e-mail
83- if (!self::send($id,$subject,$text)) return error::note('_ADMIN_MAIL_FAILED');
83+ if (!self::send($id,$subject,$text)) return jerror::note('_ADMIN_MAIL_FAILED');
8484 // Store reactivation key to DB
8585 $row=array('memberid'=>$id,'key'=>hash('sha512',_HASH_SALT.$key),'timestamp'=>time());
8686 sql::select_pdo('member');
@@ -94,7 +94,7 @@
9494 $text.=self::translate('_ADMIN_MAIL_REACTIVATE_BAD_ACCOUNT_TEXT2')."\n";
9595 $text.='IP: '.$_SERVER['REMOTE_ADDR']."\nID: ".$_POST['loginname']."\n";
9696 // Send e-mail
97- if (!self::send($id,$subject,$text)) return error::note('_ADMIN_MAIL_FAILED');
97+ if (!self::send($id,$subject,$text)) return jerror::note('_ADMIN_MAIL_FAILED');
9898 }
9999 core::set_cookie('note_text',self::translate('_ADMIN_MAIL_FORGOTPASSWORD_DONE'),0);
100100 core::redirect_local(_CONF_URL_ADMIN);
@@ -104,10 +104,10 @@
104104 $array=array('id'=>$_GET['mid'],'key'=>hash('sha512',_HASH_SALT.$_GET['reactivate']));
105105 sql::select_pdo('member');
106106 $row=sql::query('SELECT memberid as id FROM jeans_reactivate WHERE memberid=<%id%> AND key=<%key%> LIMIT 1',$array)->fetch();
107- if (!$row) return error::note('_ADMIN_MAIL_REACTIVATE_INVALID_KEY');
107+ if (!$row) return jerror::note('_ADMIN_MAIL_REACTIVATE_INVALID_KEY');
108108 // Check if passwords matches and are good.
109- if ($_POST['password1_text']!=$_POST['password2_text']) return error::note(self::translate('_ADMIN_MEMBERINFO_PASSWORD_MISMATCH'));
110- if (strlen($_POST['password1_text'])<6) return error::note(self::translate('_ADMIN_MEMBERINFO_PASSWORD_TOO_SHORT'));
109+ if ($_POST['password1_text']!=$_POST['password2_text']) return jerror::note(self::translate('_ADMIN_MEMBERINFO_PASSWORD_MISMATCH'));
110+ if (strlen($_POST['password1_text'])<6) return jerror::note(self::translate('_ADMIN_MEMBERINFO_PASSWORD_TOO_SHORT'));
111111 // Update DB
112112 $array=array('id'=>$row['id'],'password'=>hash('sha512',_HASH_SALT.$_POST['password1_text']));
113113 sql::select_pdo('member');
@@ -121,7 +121,7 @@
121121 }
122122 static public function action_post_sendmessage(){
123123 if (strlen($_POST['message_text'])==0) {
124- error::note(self::translate('_ADMIN_MAIL_NO_EMPTY_MESSAGE'));
124+ jerror::note(self::translate('_ADMIN_MAIL_NO_EMPTY_MESSAGE'));
125125 return;
126126 }
127127 $from_member=!empty($_POST['frommember']);
@@ -132,10 +132,10 @@
132132 $message.=_CONF_URL_INDEX.'?memberid='.self::setting('id')."\n";
133133 $message.="-----\n".$_POST['message_text'];
134134 if (self::send($_POST['mid'],$subject,$message,$from_member)) {
135- error::note('_ADMIN_MAIL_PRIVATE_MESSAGE_SUCESS');
135+ jerror::note('_ADMIN_MAIL_PRIVATE_MESSAGE_SUCESS');
136136 unset($_POST['message_text']);
137137 } else {
138- error::note('_ADMIN_MAIL_PRIVATE_MESSAGE_FAILED');
138+ jerror::note('_ADMIN_MAIL_PRIVATE_MESSAGE_FAILED');
139139 }
140140 }
141141 }
\ No newline at end of file
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_media.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_media.php (revision 363)
@@ -10,7 +10,7 @@
1010 // Authority check for the action.
1111 $warning=self::translate('_ADMIN_NO_PERMISSION');
1212 $mid=isset($_GET['mid']) ? intval($_GET['mid']) : member::setting('id');
13- if (!_CONF_ALLOW_FILE_UPLOAD || !member::logged_in()) error::quit($warning);
13+ if (!_CONF_ALLOW_FILE_UPLOAD || !member::logged_in()) jerror::quit($warning);
1414 if (member::is_admin()) {
1515 self::$max_size=_CONF_MAX_UPLOAD_SIZE;
1616 } elseif ($mid==member::setting('id')) {
@@ -19,7 +19,7 @@
1919 $res=sql::query('SELECT binsize FROM jeans_binary WHERE type="media" AND contextid=<%0%>',member::setting('id'));
2020 while ($row=$res->fetch()) $max_total=$max_total-$row['binsize'];
2121 if ($max_total < $max_size) $max_size=$max_total;
22- } else error::quit($warning);
22+ } else jerror::quit($warning);
2323 self::member_id($mid);
2424 self::$accepted=preg_split('/[^a-zA-Z0-9]+/',strtolower(_CONF_ALLOW_FILE_TYPES),-1,PREG_SPLIT_NO_EMPTY);
2525 // Thumbnail
@@ -32,7 +32,7 @@
3232 }
3333 static public function action_post_upload(){
3434 // Get information of uploaded file
35- if (!isset($_FILES['binfile'])) return error::note('_ADMIN_MEDIA_FILE_NOT_FOUND');
35+ if (!isset($_FILES['binfile'])) return jerror::note('_ADMIN_MEDIA_FILE_NOT_FOUND');
3636 $file=&$_FILES['binfile'];
3737 switch ($file['error']) {
3838 case UPLOAD_ERR_OK:
@@ -39,30 +39,30 @@
3939 break;
4040 case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_FORM_SIZE:
4141 @unlink($file['tmp_name']);
42- return error::note('_ADMIN_MEDIA_FILE_TOO_LARGE');
42+ return jerror::note('_ADMIN_MEDIA_FILE_TOO_LARGE');
4343 default:
4444 @unlink($file['tmp_name']);
45- return error::note('_ADMIN_MEDIA_UNKNOWN_ERROR');
45+ return jerror::note('_ADMIN_MEDIA_UNKNOWN_ERROR');
4646 }
4747 // Check if upload is accepted to this file.
4848 $size=filesize($file['tmp_name']);
4949 if (self::$max_size < $size) {
5050 @unlink($file['tmp_name']);
51- return error::note(self::translate('_ADMIN_MEDIA_FILE_TOO_LARGE').'(max: '.self::$max_size.')');
51+ return jerror::note(self::translate('_ADMIN_MEDIA_FILE_TOO_LARGE').'(max: '.self::$max_size.')');
5252 }
5353 if (!preg_match('/^(.+\.)([a-zA-Z0-9]+)$/',trim($file['name']),$m)) {
5454 @unlink($file['tmp_name']);
55- return error::note('_ADMIN_MEDIA_INVALID_FILENAME');
55+ return jerror::note('_ADMIN_MEDIA_INVALID_FILENAME');
5656 }
5757 $m[2]=strtolower($m[2]);
5858 if (!in_array($m[2],self::$accepted)) {
5959 @unlink($file['tmp_name']);
60- return error::note('_ADMIN_MEDIA_INVALID_FILE_TYPE');
60+ return jerror::note('_ADMIN_MEDIA_INVALID_FILE_TYPE');
6161 }
6262 $m[1]=self::utf8($m[1]);
6363 if (strlen($m[1])==0) {
6464 @unlink($file['tmp_name']);
65- return error::note('_ADMIN_MEDIA_INVALID_FILENAME');
65+ return jerror::note('_ADMIN_MEDIA_INVALID_FILENAME');
6666 }
6767 // Get image information and thumbnail if possible
6868 $file_name=$m[1].$m[2];
@@ -105,7 +105,7 @@
105105 sql::query($query,array('row'=>$row));
106106 }
107107 if ($res->rowCount()) {
108- error::note('_ADMIN_MEDIA_UPLOAD_DONE');
108+ jerror::note('_ADMIN_MEDIA_UPLOAD_DONE');
109109 $array=array('name'=>$file_name,'size'=>$size,'mime'=>$mime,'time'=>_NOW);
110110 foreach($xml as $key=>$value) $array[$key]=$value;
111111 $array['type']=isset($array['width']) ? 'image':'media';
@@ -112,7 +112,7 @@
112112 // Set information of the uploaded file
113113 self::uploaded_file($array);
114114 } else {
115- error::note('_ADMIN_MEDIA_UPLOAD_FAILED');
115+ jerror::note('_ADMIN_MEDIA_UPLOAD_FAILED');
116116 }
117117 }
118118 static public function uploaded_file($info=false){
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_memberinfo.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_memberinfo.php (revision 363)
@@ -13,8 +13,8 @@
1313 // The member also can use this class, but only for own information.
1414 self::$mid=empty($_GET['mid'])? false:(int)$_GET['mid'];
1515 if (!member::is_admin()) {
16- if (!member::logged_in()) error::quit($warning);
17- if (self::$mid!=member::setting('id')) error::quit($warning);
16+ if (!member::logged_in()) jerror::quit($warning);
17+ if (self::$mid!=member::setting('id')) jerror::quit($warning);
1818 }
1919 }
2020 static public function data($key,$mid=false){
@@ -94,7 +94,7 @@
9494 $array=array('name'=>$post['name'],'id'=>$_GET['mid']);
9595 if (sql::query($query,$array)->fetch()) {
9696 // The name is already used.
97- error::note(_ADMIN_MEMBERINFO_NAME_USED);
97+ jerror::note(_ADMIN_MEMBERINFO_NAME_USED);
9898 return;
9999 }
100100 $xml=new SimpleXMLElement(_XML_BLANC);
@@ -145,7 +145,7 @@
145145 if (!isset($post['password'])) return;
146146 // Check if password is correct
147147 if (!member::try_login(member::setting('loginname'),$post['password'])){
148- error::note('_ADMIN_MEMBERINFO_WRONG_PASSWORD');
148+ jerror::note('_ADMIN_MEMBERINFO_WRONG_PASSWORD');
149149 return;
150150 }
151151 // Set authority flags
@@ -174,8 +174,8 @@
174174 'password'=>hash('sha512',_HASH_SALT.$post['password1']),
175175 'flags'=>$post['flags']);
176176 // Let's check the authority here again for security though it's checked in init() method.
177- if (!member::logged_in()) error::quit(_ADMIN_NO_PERMISSION);
178- if (member::setting('id')!=self::$mid && !member::is_admin()) error::quit(_ADMIN_NO_PERMISSION);
177+ if (!member::logged_in()) jerror::quit(_ADMIN_NO_PERMISSION);
178+ if (member::setting('id')!=self::$mid && !member::is_admin()) jerror::quit(_ADMIN_NO_PERMISSION);
179179 sql::select_pdo('member');
180180 $res=sql::query($query,$array);
181181 // Everything is done. Show the information.
@@ -190,7 +190,7 @@
190190 }
191191 static private function add_member($post){
192192 // Let's check the authority here again for security though it's checked in init() method.
193- if (!member::is_admin()) error::quit(_ADMIN_NO_PERMISSION);
193+ if (!member::is_admin()) jerror::quit(_ADMIN_NO_PERMISSION);
194194 // Check if loginname, e-mail, and name are OK.
195195 $query='SELECT id FROM jeans_login WHERE email=<%email%> OR loginname=<%loginname%>';
196196 sql::select_pdo('member');
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_plugin.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_plugin.php (revision 363)
@@ -9,7 +9,7 @@
99 // Load the language file
1010 $warning=self::translate('_ADMIN_NO_PERMISSION');
1111 // Only superadmin can use this class
12- if (!member::is_admin()) error::quit($warning);
12+ if (!member::is_admin()) jerror::quit($warning);
1313 // Register SQL function
1414 sql::pdo()->sqliteCreateFunction('libs_admin_plugin_deleteunusedplugins',array('admin_plugin','cb_action_post_deleteunusedoptions'),1);
1515 }
@@ -89,8 +89,8 @@
8989 }
9090 static public function action_post_install(){
9191 $plugin=$_POST['plugin'];
92- if (!preg_match('/^[jp_[a-zA-Z0-9]+$/',$plugin)) return error::note('Invalid plugin name');
93- if (!self::local_file_exists(_DIR_PLUGINS,"$plugin.php")) return error::note('Plugin file not found.');
92+ if (!preg_match('/^[jp_[a-zA-Z0-9]+$/',$plugin)) return jerror::note('Invalid plugin name');
93+ if (!self::local_file_exists(_DIR_PLUGINS,"$plugin.php")) return jerror::note('Plugin file not found.');
9494 plugin::set_install($plugin);
9595 if (class_exists($plugin)) {
9696 self::refresh_plugin_info($plugin);
@@ -97,7 +97,7 @@
9797 core::set_cookie('note_text',_ADMIN_PLUGIN_INSTALL_SUCESS,0);
9898 core::redirect_local(_CONF_SELF.'?page=plugin');
9999 }
100- error::note(_ADMIN_PLUGIN_INSTALL_FAILED);
100+ jerror::note(_ADMIN_PLUGIN_INSTALL_FAILED);
101101
102102 }
103103 static public function action_post_deleteunusedoptions(){
@@ -117,7 +117,7 @@
117117 sql::query($query);
118118 }
119119 sql::commit();
120- error::note('_ADMIN_PLUGIN_DELETEUNUSEDOPTIONS_DONE');
120+ jerror::note('_ADMIN_PLUGIN_DELETEUNUSEDOPTIONS_DONE');
121121 }
122122 static public function cb_action_post_deleteunusedoptions(&$xmltext){
123123 static $plugins;
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_plugin2.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_plugin2.php (revision 363)
@@ -12,15 +12,15 @@
1212 $plugin=$_GET['guest_padmin'];
1313 $skin='guest_skin.inc';
1414 } elseif (isset($_GET['member_padmin'])) {
15- if (!member::if_loggedin()) error::quit('_ADMIN_NO_PERMISSION');
15+ if (!member::if_loggedin()) jerror::quit('_ADMIN_NO_PERMISSION');
1616 $plugin=$_GET['member_padmin'];
1717 $skin='member_skin.inc';
1818 } elseif (isset($_GET['padmin']) && member::is_admin()) {
19- if (!member::is_admin()) error::quit('_ADMIN_NO_PERMISSION');
19+ if (!member::is_admin()) jerror::quit('_ADMIN_NO_PERMISSION');
2020 $plugin=$_GET['padmin'];
2121 $skin='skin.inc';
2222 } else return;
23- if (substr($plugin,0,3)!='jp_' || !plugin::plugin_list($plugin)) error::quit('_ADMIN_PLUGIN_NOT_FOUND');
23+ if (substr($plugin,0,3)!='jp_' || !plugin::plugin_list($plugin)) jerror::quit('_ADMIN_PLUGIN_NOT_FOUND');
2424 view::tag_parse($data,'/jp/'.substr($plugin,3)."/$skin");
2525 }
2626 }
\ No newline at end of file
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_sql.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_sql.php (revision 363)
@@ -9,7 +9,7 @@
99 // Load the language file
1010 $warning=self::translate('_ADMIN_NO_PERMISSION');
1111 // Only superadmin can use this class
12- if (!member::is_admin()) error::quit($warning);
12+ if (!member::is_admin()) jerror::quit($warning);
1313 // Register function to be used in query
1414 sql::pdo()->sqliteCreateFunction('get_table_index',array('admin_sql','get_table_index'),1);
1515 }
@@ -43,7 +43,7 @@
4343 sql::select_pdo($mode);
4444 sql::query('VACUUM;');
4545 }
46- error::note('_ADMIN_VACUUM_DONE');
46+ jerror::note('_ADMIN_VACUUM_DONE');
4747 }
4848 static private $query='';
4949 static public function action_post_query(){
@@ -223,8 +223,8 @@
223223 $query=sql::fill_query($query,array('table'=>$table));
224224 sql::query($query,array('id'=>$id,'row'=>$row));
225225 $array=array('id'=>$id,'table'=>$table);
226- if (!$id) error::note('New item on <%table%> table was created.', $array);
227- elseif ($delete) error::note('The item (id: <%id%>) on <%table%> table was deleted.', $array);
228- else error::note('The item (id: <%id%>) on <%table%> table was saved.', $array);
226+ if (!$id) jerror::note('New item on <%table%> table was created.', $array);
227+ elseif ($delete) jerror::note('The item (id: <%id%>) on <%table%> table was deleted.', $array);
228+ else jerror::note('The item (id: <%id%>) on <%table%> table was saved.', $array);
229229 }
230230 }
\ No newline at end of file
--- jeanscms/branches/jeans7/jeans/libs/admin/admin_temp.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin/admin_temp.php (revision 363)
@@ -49,6 +49,6 @@
4949 $dir=dirname(_CONF_DB_MAIN);
5050 if (is_writable($dir)) return $dir;
5151 }
52- error::quit('Cannot create temporary file');
52+ jerror::quit('Cannot create temporary file');
5353 }
5454 }
\ No newline at end of file
--- jeanscms/branches/jeans7/jeans/libs/admin.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/admin.php (revision 363)
@@ -46,7 +46,7 @@
4646 break;
4747 }
4848 $page='main';
49- error::note(_ADMIN_FEATURE_NOT_IMPLEMENTED);
49+ jerror::note(_ADMIN_FEATURE_NOT_IMPLEMENTED);
5050 }
5151 switch($page){
5252 case 'main': case 'reactivate': case 'forgotpassword':
@@ -55,13 +55,13 @@
5555 case 'commentlist': case 'batch': case 'membersetting': case 'loginsetting': case 'media':
5656 case 'editcomment':
5757 // Accept admin and member
58- if (!member::logged_in()) error::quit(_ADMIN_NO_PERMISSION);
58+ if (!member::logged_in()) jerror::quit(_ADMIN_NO_PERMISSION);
5959 break;
6060 default:
6161 if (substr($page,0,6)=='guest_') break;
6262 elseif (substr($page,0,7)=='member_' && member::logged_in()) break;
6363 // Only superadmin can go ahead
64- if (!member::is_admin()) error::quit(_ADMIN_NO_PERMISSION);
64+ if (!member::is_admin()) jerror::quit(_ADMIN_NO_PERMISSION);
6565 }
6666 $template=array('libs'=>array('admin'=>array(
6767 'page'=>$page,
--- jeanscms/branches/jeans7/jeans/libs/blog.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/blog.php (revision 363)
@@ -32,7 +32,7 @@
3232 $template='index';
3333 if (class_exists('error',false)) {
3434 // Note that the class 'error' exists when $_COOKIE['note_text'] is set.
35- if (error::fatal() || isset($_GET['error'])) $template='error';
35+ if (jerror::fatal() || isset($_GET['error'])) $template='error';
3636 }
3737 $category=isset($_GET['sgid'])?$_GET['sgid']:0;
3838 if ($template=='error') {
@@ -42,7 +42,7 @@
4242 $category=parent::sgsetting('id');
4343 if (item::setting('flags') & sql::FLAG_INVALID) {
4444 $template='error';
45- error::fatal('_JEANS_ERROR_ITEM_NOT_EXIST');
45+ jerror::fatal('_JEANS_ERROR_ITEM_NOT_EXIST');
4646 }
4747 } elseif (isset($_GET['archive'])) {
4848 $template='archive';
@@ -62,13 +62,13 @@
6262 if (!parent::setting('id')) {
6363 $template='error';
6464 parent::set_id(_CONF_DEFAULT_GROUP);
65- error::fatal('_JEANS_ERROR_BLOG_NOT_EXIST');
65+ jerror::fatal('_JEANS_ERROR_BLOG_NOT_EXIST');
6666 }
6767 if ($category && $template!='error') {
6868 self::set_sgid($category);
6969 if (!parent::sgsetting('id')) {
7070 $template='error';
71- error::fatal('_JEANS_ERROR_CATEGORY_NOT_EXIST');
71+ jerror::fatal('_JEANS_ERROR_CATEGORY_NOT_EXIST');
7272 }
7373 }
7474 $skin=parent::setting('group_skin');
--- jeanscms/branches/jeans7/jeans/libs/group.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/group.php (revision 363)
@@ -15,8 +15,8 @@
1515 self::$subgroupid=$row['id'];
1616 if ($row['gid']) self::$groupid=(int)$row['gid'];
1717 elseif ($row['sgid']==0) self::$groupid=(int)$row['id'];
18- else error::fatal('_JEANS_ERROR_SUBGROUP_NOT_EXIST');
19- } else error::fatal('_JEANS_ERROR_SUBGROUP_NOT_EXIST');
18+ else jerror::fatal('_JEANS_ERROR_SUBGROUP_NOT_EXIST');
19+ } else jerror::fatal('_JEANS_ERROR_SUBGROUP_NOT_EXIST');
2020 } elseif (isset($_GET['itemid'])) {
2121 $query='SELECT gid,sgid FROM jeans_item WHERE id=<%itemid%>';
2222 $array=array('itemid'=>(int)$_GET['itemid']);
@@ -24,7 +24,7 @@
2424 if ($row) {
2525 self::$groupid=(int)$row['gid'];
2626 self::$subgroupid=(int)$row['sgid'];
27- } else error::fatal('_JEANS_ERROR_ITEM_NOT_EXIST');
27+ } else jerror::fatal('_JEANS_ERROR_ITEM_NOT_EXIST');
2828 }
2929 if (!isset(self::$groupid)) self::$groupid=(int)_CONF_DEFAULT_GROUP;
3030 }
--- jeanscms/branches/jeans7/jeans/libs/jeans.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/jeans.php (revision 363)
@@ -114,7 +114,7 @@
114114 }
115115 static public final function local_file_exists($dir,$file){
116116 // Check null byte
117- if (preg_match('/[\x00]/',$dir) || preg_match('/[\x00]/',$file)) error::quit('Null byte attack attempt for file function.');
117+ if (preg_match('/[\x00]/',$dir) || preg_match('/[\x00]/',$file)) jerror::quit('Null byte attack attempt for file function.');
118118 // Support Windows
119119 $dir=str_replace('\\','/',$dir);
120120 $file=str_replace('\\','/',$file);
@@ -135,7 +135,7 @@
135135 if (is_dir($fullpath) && substr($fullpath,-1)!='/') $fullpath.='/';
136136 if (strpos(realpath($fullpath),realpath($dir))===0) return false;
137137 }
138- error::quit('Directory traversal attempt by file: <%1%><br /> in directory: <%0%>',array($dir,$file));
138+ jerror::quit('Directory traversal attempt by file: <%1%><br /> in directory: <%0%>',array($dir,$file));
139139 exit;
140140 }
141141 static public final function local_file_contents($dir,$file){
@@ -214,7 +214,7 @@
214214 }
215215 static private function find_emulator(){
216216 if (!function_exists('hash')){
217- if (!class_exists('misc_hash')) error::quit('Available hash() function was not found.');
217+ if (!class_exists('misc_hash')) jerror::quit('Available hash() function was not found.');
218218 }
219219 }
220220 static private function check_input(&$data,$stop_mode=false,$orgkey=''){
@@ -222,7 +222,7 @@
222222 foreach ($data as $key=>$value) {
223223 if ($stop_mode) {
224224 if ((string)$key!==self::utf8($key) || !preg_match(_PREG_SAFE_TEXT,$key)) {
225- error::quit('Invalid input!');
225+ jerror::quit('Invalid input!');
226226 }
227227 }
228228 if (!is_numeric($key)) $orgkey=$key;
@@ -248,7 +248,7 @@
248248 break;
249249 }
250250 } elseif (preg_match(_PREG_SAFE_TEXT,$data) && (string)$data===self::utf8($data)) return;
251- error::quit('Invalid input(<%key%>)!',array('key'=>$orgkey));
251+ jerror::quit('Invalid input(<%key%>)!',array('key'=>$orgkey));
252252 } else {
253253 $data=self::utf8($data);
254254 }
@@ -328,7 +328,7 @@
328328 date_default_timezone_set(_CONF_TIMEZONE);
329329 // Set note from previous session
330330 if (!empty($_COOKIE['note_text'])) {
331- error::note('<%note_text%>',$_COOKIE);
331+ jerror::note('<%note_text%>',$_COOKIE);
332332 self::set_cookie('note_text','',0);
333333 }
334334 // Cancel magic_quotes_gpc (this routine will be removed after shifting to PHP6)
@@ -381,10 +381,10 @@
381381 $mode='post';
382382 $action=$_POST['action'];
383383 if (!_CONF_DB_TYPE || !_CONF_DB_LOGIN || !self::class_exists('ticket')) {
384- error::note('_ADMIN_ACTION_NOT_FOUND');
384+ jerror::note('_ADMIN_ACTION_NOT_FOUND');
385385 return;
386386 } elseif (!ticket::check()) {
387- error::note('_ADMIN_INVALID_TICKET');
387+ jerror::note('_ADMIN_INVALID_TICKET');
388388 return;
389389 }
390390 } elseif (isset($_GET['action'])) {
@@ -412,7 +412,7 @@
412412 }
413413 // post_action event or registration of error
414414 if (is_string($err) && strlen($err)) {
415- error::note($err);
415+ jerror::note($err);
416416 } else {
417417 if ($mode=='post') self::event('post_action',array('action'=>$action,'class'=>$class,'method'=>$method));
418418 }
@@ -421,12 +421,12 @@
421421 static $method_exists=false;
422422 if ($check_mode) return $method_exists=(bool)$class;
423423 $class=strtolower($class);
424- if (!preg_match('/^[a-zA-Z0-9_]+$/',$class)) error::quit('Class name error: <%0%>',$class);
424+ if (!preg_match('/^[a-zA-Z0-9_]+$/',$class)) jerror::quit('Class name error: <%0%>',$class);
425425 // Include PHP file
426426 $array=self::class_file($class);
427427 if (!$array) {
428428 if ($method_exists) return $method_exists=false;
429- else error::quit('Class file does not exist or is disabled: <%0%>',$class);
429+ else jerror::quit('Class file does not exist or is disabled: <%0%>',$class);
430430 } else $method_exists=false;
431431 list($dir,$file,$is_plugin)=$array;
432432 if ($is_plugin && !$file) return false;
@@ -499,7 +499,7 @@
499499 }
500500 static public function error_exists(){
501501 if (!class_exists('error',false)) return false;
502- return count(error::get_note());
502+ return count(jerror::get_note());
503503 }
504504 /**
505505 * Following method will be called when shutting down.
@@ -533,7 +533,7 @@
533533 static public function redirect($url){
534534 if (!self::is_valid_url($url)) {
535535 if (!preg_match('/^[a-zA-Z0-9\-\.]*\??[a-zA-Z0-9\-\.=&]*/',$url)) {
536- error::quit('Invalied URL: <%0%>',$url);
536+ jerror::quit('Invalied URL: <%0%>',$url);
537537 }
538538 }
539539 header('Location: ' . $url);
@@ -541,7 +541,7 @@
541541 }
542542 static public function redirect_local($url){
543543 if (preg_match('#^[^/\?]*//([^/]+)/#',$url,$m)) {
544- if ($m[1]!=$_SERVER['HTTP_HOST']) error::quit('Invalied local URL: <%0%>',$url);
544+ if ($m[1]!=$_SERVER['HTTP_HOST']) jerror::quit('Invalied local URL: <%0%>',$url);
545545 }
546546 self::redirect($url);
547547 }
@@ -623,7 +623,7 @@
623623 try {
624624 $pdo=new PDO($dsn,$user,$passwd);
625625 } catch (PDOException $e) {
626- //error::quit('DB-connection falied.');
626+ //jerror::quit('DB-connection falied.');
627627 $pdo=new dummy_pdo;
628628 }
629629 // register user functions
@@ -754,7 +754,7 @@
754754 if (!is_object($obj)) {
755755 $e=self::$pdo->errorInfo();
756756 $e['query']=$query;
757- if (error_reporting() & E_WARNING) error::show('<%query%><br /><%2%> (<%0%> <%1%>)<br />',$e);
757+ if (error_reporting() & E_WARNING) jerror::show('<%query%><br /><%2%> (<%0%> <%1%>)<br />',$e);
758758 } else {
759759 $obj->setFetchMode($mode);
760760 $obj->execute($data);
--- jeanscms/branches/jeans7/jeans/libs/jerror.php (nonexistent)
+++ jeanscms/branches/jeans7/jeans/libs/jerror.php (revision 363)
@@ -0,0 +1,98 @@
1+<?php
2+/*
3+ * Jeans CMS (GPL license)
4+ * $Id$
5+ */
6+
7+
8+class jerror extends jeans {
9+ static private function debug_mode(){
10+ if (!defined('_CONF_DEBUG_MODE')) return false;
11+ if ($_SERVER['REMOTE_ADDR']=='127.0.0.1') return true;
12+ if (_CONF_DEBUG_MODE==='admin') return member::is_admin();
13+ return true;
14+ }
15+ static public function quit($text,$data=array()){
16+ self::show($text,$data,'quit');
17+ exit;
18+ }
19+ static public function show($text,$data=array(),$log='show'){
20+ if (preg_match('/^_([A-Z][A-Z0-9]*)_([A-Z0-9]*)(?:_[A-Z0-9]*)*$/',$text,$m)) $text=self::translate($text);
21+ // Leave log
22+ $row=sql::query("SELECT count(*) as result FROM sqlite_master WHERE name='jeans_log'")->fetch();
23+ if ($row['result']==1) core::log(self::fill_html($text,$data),__CLASS__,$log);
24+ // Redirect, if possible
25+ if (!self::debug_mode()) {
26+ if (error_reporting() & E_WARNING) {
27+ $text=self::fill_html($text,$data);
28+ if (headers_sent() || isset($_GET['error'])) {
29+ self::echo_html('<!--\'"--><%0%>',$text);
30+ } else {
31+ core::set_cookie('note_text',$text);
32+ core::redirect_local('?error');
33+ }
34+ }
35+ return;
36+ }
37+ if (!is_array($data)) $data=array($data);
38+ self::echo_html('<!--\'"-->'.$text,$data);
39+ $db=debug_backtrace();
40+ self::echo_html('<!--');
41+ ob_start();
42+ print_r($db);
43+ self::p(ob_get_clean());
44+ self::echo_html('-->');
45+ for ($i=0;$i<count($db);$i++) {
46+ if ($db[$i]['class']=='error') continue;
47+ $db=$db[$i-1];
48+ break;
49+ }
50+ $db['file']=@preg_replace('/^.*[\/\\\\]([a-z0-9_]+\.php)$/i','$1',$db['file']);
51+ self::echo_html("<br />\r\nError occured at line <%line%> in <%file%>",$db);
52+ }
53+ static private $note=array();
54+ static public function note($text,$data=false){
55+ if ($data===false) {
56+ self::$note[]=self::quote_html($text);
57+ } else {
58+ if (preg_match('/^_([A-Z][A-Z0-9]*)_([A-Z0-9]*)(?:_[A-Z0-9]*)*$/',$text)) $text=self::translate($text);
59+ self::$note[]=self::fill_html($text,$data);
60+ }
61+ }
62+ static public function fatal($text=false,$data=false){
63+ static $fatal=false;
64+ if ($text===false) return $fatal;
65+ $fatal=true;
66+ self::note($text,$data);
67+ }
68+ static public function get_note(){
69+ foreach (self::$note as $key=>$error) {
70+ if (preg_match('/^_([A-Z][A-Z0-9]*)_([A-Z0-9]*)(?:_[A-Z0-9]*)*$/',$error)) self::$note[$key]=self::translate($error);
71+ }
72+ return self::$note;
73+ }
74+ static public function tag_note(&$data,$skin){
75+ $array=array();
76+ foreach (self::get_note() as $error) {
77+ $array[]=array('error'=>$error);
78+ }
79+ view::show_using_array($data,$array,$skin);
80+ }
81+ // From view.php
82+ static public function compile_error($source,$compiled){
83+ if (self::debug_mode()) {
84+ $array=array(&$source,&$compiled);
85+ foreach($array as &$temp) {
86+ $temp=preg_split('/(\r\n|\r|\n)/',$temp);
87+ foreach($temp as $key=>$line) $temp[$key]=substr(' '.($key+1).':',-4).$line;
88+ $temp=implode("\n",$temp);
89+ }
90+ self::echo_html('<hr /><pre><%0%><hr /><%1%></pre><hr />',array($source,$compiled),'hsc');
91+ }
92+ return create_function('','return false;');
93+ }
94+ // From core.php
95+ static public function set_error($mode,$error,$array=array()){
96+
97+ }
98+}
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+CRLF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id HeadURL LastChangedDate LastChangedBy LastChangedRevision
\ No newline at end of property
--- jeanscms/branches/jeans7/jeans/libs/member.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/member.php (revision 363)
@@ -67,13 +67,13 @@
6767 // Check authority
6868 if ($row && !($row['authority']&self::MEMBER_CAN_LOGIN)) {
6969 $row=false;
70- error::note('_JEANS_LOGIN_NOT_ALLOWED');
70+ jerror::note('_JEANS_LOGIN_NOT_ALLOWED');
7171 }
7272 // Check multiple failure (blute fource attack?)
7373 $ip16=preg_replace('/\.[0-9]+\.[0-9]+$/','',$_SERVER['REMOTE_ADDR']);
7474 $stop=self::anti_blute_fource($name,$ip16);
7575 if ($stop) {
76- error::note('Account is invalid for <%0%> seconds.',$stop);
76+ jerror::note('Account is invalid for <%0%> seconds.',$stop);
7777 $row=false;
7878 }
7979
@@ -89,7 +89,7 @@
8989 } else {
9090 // fail
9191 self::setting(array('id'=>0));
92- error::note('_JEANS_LOGIN_FAILED');
92+ jerror::note('_JEANS_LOGIN_FAILED');
9393 if (isset($_POST['login'])) {
9494 core::event('login_failed',array('user'=>$_POST['login']));
9595 $text=self::fill_html('Login Failed <%0%>',$ip16);
--- jeanscms/branches/jeans7/jeans/libs/ticket.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/ticket.php (revision 363)
@@ -43,7 +43,7 @@
4343 foreach ($hosts as $host) {
4444 if ($host && preg_match("#^(http|https)://$host/#",$referer)) return;
4545 }
46- error::quit(self::translate('_ADMIN_INVALID_REFERER_FOR_POST'));
46+ jerror::quit(self::translate('_ADMIN_INVALID_REFERER_FOR_POST'));
4747 }
4848 static private $tickets=array();
4949 static public function buy_ticket($action=''){
--- jeanscms/branches/jeans7/jeans/libs/view.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/libs/view.php (revision 363)
@@ -115,7 +115,7 @@
115115 if (!isset($cache[$skin])) {
116116 // Determine the file name (note that skin may be inherited)
117117 $filename=self::find_skin_file($skin);
118- if (!$filename) error::quit('Skin file not found: <%0%>',$skin);
118+ if (!$filename) jerror::quit('Skin file not found: <%0%>',$skin);
119119 $file=self::local_file_contents(_DIR_SKINS,$filename);
120120 if ($file===false && preg_match('#^/jp/([a-zA-Z0-9_]+)/(.*)$#',$skin,$m)) {
121121 $file=self::local_file_contents(_DIR_PLUGINS,"$m[1]/$m[2]");
@@ -141,7 +141,7 @@
141141 if (!$lambda) return $compiled;
142142 // Create lambda
143143 $code=create_function('&$data','?>'.$compiled.'<?php return true;');
144- if (!is_callable($code)) return error::compile_error($source,$compiled);
144+ if (!is_callable($code)) return jerror::compile_error($source,$compiled);
145145 return $code;
146146 }
147147 static private $compile_using=array();
@@ -171,7 +171,7 @@
171171 // If-tags.
172172 $tag=isset($if[2]) ? $if[2]:'';
173173 $method=self::compile_cb_method($tag,'if_');
174- if ($method===false) error::quit('If-tag not found: <%0%>',$tag);
174+ if ($method===false) jerror::quit('If-tag not found: <%0%>',$tag);
175175 switch($if[1]){
176176 case 'ifnot':
177177 return "<?php $cr if (!( $method($args) )) { ?>";
@@ -260,8 +260,9 @@
260260 $class=$m[0];
261261 $method=$prefix.$m[0];
262262 }
263- } else error::quit('Syntax error: <%0%>',$text);
263+ } else jerror::quit('Syntax error: <%0%>',$text);
264264 if (core::method_exists($class,$method)) return "$class::$method";
265+ elseif (core::method_exists("j$class",$method)) return "j$class::$method"; // Support jerror class (etc)
265266 else return false;
266267 }
267268 /*
--- jeanscms/branches/jeans7/jeans/plugins/skinfiles/jp_SkinFiles_class.php (revision 362)
+++ jeanscms/branches/jeans7/jeans/plugins/skinfiles/jp_SkinFiles_class.php (revision 363)
@@ -10,7 +10,7 @@
1010 static private $real_dir_path='', $real_file_path='';
1111 static public function init(){
1212 // Only superadmin can use this class
13- if (!member::is_admin()) error::quit('_ADMIN_NO_PERMISSION');
13+ if (!member::is_admin()) jerror::quit('_ADMIN_NO_PERMISSION');
1414 // Get the path and resolve skin extension
1515 // Note that the dir_path must end with '/' except for root path.
1616 if (isset($_GET['dir_path'])) self::$dir_path=$_GET['dir_path'];
@@ -42,11 +42,11 @@
4242 self::$real_dir_path=self::to_realpath(self::$dir_path);
4343 self::$real_file_path=self::to_realpath(self::$file_path);
4444 if (self::$real_dir_path===false) {
45- error::note('_JP_SKINFILES_DIR_NOT_FOUND',self::$dir_path);
45+ jerror::note('_JP_SKINFILES_DIR_NOT_FOUND',self::$dir_path);
4646 self::$real_dir_path=self::$dir_path='';
4747 self::$real_file_path=self::$file_path=self::$file='';
4848 } elseif (self::$real_file_path===false) {
49- error::note('_JP_SKINFILES_FILE_NOT_FOUND',self::$file_path);
49+ jerror::note('_JP_SKINFILES_FILE_NOT_FOUND',self::$file_path);
5050 self::$real_dir_path=self::$dir_path='';
5151 self::$real_file_path=self::$file_path=self::$file='';
5252 }
@@ -278,14 +278,14 @@
278278 static public function action_get_thumbnail(){
279279 // Check the local file.
280280 $full_path=self::local_file_exists(_DIR_SKINS,self::$real_file_path);
281- if (!$full_path) error::quit('File not found');
281+ if (!$full_path) jerror::quit('File not found');
282282 $time=filemtime(_DIR_SKINS.self::$real_file_path);
283283 // Check if modified (the browser would store a cache).
284284 media::check_if_changed($time);
285285 // Check if the file is an image.
286- if (!preg_match('/\.([^\.]+)$/',self::$file,$m)) error::quit('Not an image.');
286+ if (!preg_match('/\.([^\.]+)$/',self::$file,$m)) jerror::quit('Not an image.');
287287 $mime=tables::mime($m[1]);
288- if (substr($mime,0,6)!='image/') error::quit('Not an image.');
288+ if (substr($mime,0,6)!='image/') jerror::quit('Not an image.');
289289 // Get the image info
290290 list($width,$height,$new_width,$new_height)=self::image_size(self::$real_file_path);
291291 // Return the image to browser (use tumbnail if possible.
@@ -299,9 +299,9 @@
299299 static public function tag_thumbnail(&$data){
300300 $file=$data['name'];
301301 // Check if the file is an image.
302- if (!preg_match('/\.([^\.]+)$/',$file,$m)) error::quit('Not an image.');
302+ if (!preg_match('/\.([^\.]+)$/',$file,$m)) jerror::quit('Not an image.');
303303 $mime=tables::mime($m[1]);
304- if (substr($mime,0,6)!='image/') error::quit('Not an image.');
304+ if (substr($mime,0,6)!='image/') jerror::quit('Not an image.');
305305 // Get the image info
306306 list($width,$height,$new_width,$new_height)=self::image_size(self::to_realpath(self::$real_dir_path.$file));
307307 // Show the img tag
@@ -346,33 +346,33 @@
346346 static public function action_post_newdir(){
347347 if (empty($_POST['newdir'])) return;
348348 if (self::local_file_exists(_DIR_SKINS,self::$real_dir_path.$_POST['newdir'])) {
349- error::note('_JP_SKINFILES_DIR_ALREADY_EXISTS');
349+ jerror::note('_JP_SKINFILES_DIR_ALREADY_EXISTS');
350350 return;
351351 }
352352 $perms=fileperms(_DIR_SKINS.self::$real_dir_path);
353353 if (@mkdir(_DIR_SKINS.self::$real_dir_path.$_POST['newdir'],$perms)) {
354- error::note('_JP_SKINFILES_NEW_DIR_WAS_CREATED');
354+ jerror::note('_JP_SKINFILES_NEW_DIR_WAS_CREATED');
355355 } else {
356- error::note('_JP_SKINFILES_CREATING_NEW_DIR_FAILED');
356+ jerror::note('_JP_SKINFILES_CREATING_NEW_DIR_FAILED');
357357 }
358358 }
359359 static public function action_post_newfile(){
360360 if (empty($_POST['newfile'])) return;
361361 if (self::local_file_exists(_DIR_SKINS,self::$real_dir_path.$_POST['newfile'])) {
362- error::note('_JP_SKINFILES_FILE_ALREADY_EXISTS');
362+ jerror::note('_JP_SKINFILES_FILE_ALREADY_EXISTS');
363363 return;
364364 }
365365 $res=@fopen(_DIR_SKINS.self::$real_dir_path.$_POST['newfile'],'x');
366366 if ($res) {
367367 fclose($res);
368- error::note('_JP_SKINFILES_NEW_FILE_WAS_CREATED');
368+ jerror::note('_JP_SKINFILES_NEW_FILE_WAS_CREATED');
369369 } else {
370- error::note('_JP_SKINFILES_CREATING_NEW_FILE_FAILED');
370+ jerror::note('_JP_SKINFILES_CREATING_NEW_FILE_FAILED');
371371 }
372372 }
373373 static public function action_post_upload(){
374374 // Get information of uploaded file
375- if (!isset($_FILES['binfile'])) return error::note('_ADMIN_MEDIA_FILE_NOT_FOUND');
375+ if (!isset($_FILES['binfile'])) return jerror::note('_ADMIN_MEDIA_FILE_NOT_FOUND');
376376 $file=&$_FILES['binfile'];
377377 switch ($file['error']) {
378378 case UPLOAD_ERR_OK:
@@ -379,26 +379,26 @@
379379 break;
380380 case UPLOAD_ERR_INI_SIZE: case UPLOAD_ERR_FORM_SIZE:
381381 @unlink($file['tmp_name']);
382- return error::note('_ADMIN_MEDIA_FILE_TOO_LARGE');
382+ return jerror::note('_ADMIN_MEDIA_FILE_TOO_LARGE');
383383 default:
384384 @unlink($file['tmp_name']);
385- return error::note('_ADMIN_MEDIA_UNKNOWN_ERROR');
385+ return jerror::note('_ADMIN_MEDIA_UNKNOWN_ERROR');
386386 }
387387 // Check if upload is accepted to this file.
388388 $size=filesize($file['tmp_name']);
389389 if (_CONF_MAX_UPLOAD_SIZE < $size) {
390390 @unlink($file['tmp_name']);
391- return error::note(self::translate('_ADMIN_MEDIA_FILE_TOO_LARGE').'(max: '._CONF_MAX_UPLOAD_SIZE.')');
391+ return jerror::note(self::translate('_ADMIN_MEDIA_FILE_TOO_LARGE').'(max: '._CONF_MAX_UPLOAD_SIZE.')');
392392 }
393393 if (!preg_match('/^(.+\.)([a-zA-Z0-9]+)$/',trim($file['name']),$m)) {
394394 @unlink($file['tmp_name']);
395- return error::note('_ADMIN_MEDIA_INVALID_FILENAME');
395+ return jerror::note('_ADMIN_MEDIA_INVALID_FILENAME');
396396 }
397397 $m[2]=strtolower($m[2]);
398398 $m[1]=self::utf8($m[1]);
399399 if (strlen($m[1])==0) {
400400 @unlink($file['tmp_name']);
401- return error::note('_ADMIN_MEDIA_INVALID_FILENAME');
401+ return jerror::note('_ADMIN_MEDIA_INVALID_FILENAME');
402402 }
403403 $filename=$m[1].$m[2];
404404 if (self::if_mediadir() && jp_skinfiles::option()->date_prefix) {
@@ -406,15 +406,15 @@
406406 }
407407 // Check if destination is OK
408408 if (self::local_file_exists(_DIR_SKINS,self::$real_dir_path.$filename)) {
409- error::note('_JP_SKINFILES_FILE_ALREADY_EXISTS');
409+ jerror::note('_JP_SKINFILES_FILE_ALREADY_EXISTS');
410410 return;
411411 }
412412 // Everything is file. Let's move file to skins/ directory
413413 if (@move_uploaded_file ($file['tmp_name'],_DIR_SKINS.self::$real_dir_path.$filename)) {
414- error::note('_JP_SKINFILES_FILE_IS_UPLOADED');
414+ jerror::note('_JP_SKINFILES_FILE_IS_UPLOADED');
415415 } else {
416416 @unlink($file['tmp_name']);
417- error::note('_JP_SKINFILES_FILE_UPLOAD_WAS_FALIED');
417+ jerror::note('_JP_SKINFILES_FILE_UPLOAD_WAS_FALIED');
418418 }
419419 }
420420 static public function action_get_mediamanager(){
@@ -431,8 +431,8 @@
431431 static public function action_post_rename(){
432432 $new_path=dirname(self::$real_file_path).'/'.$_POST['new_path'];
433433 if (self::local_file_exists(_DIR_SKINS,$new_path)) {
434- if (is_dir(_DIR_SKINS.$new_path)) error::note('_JP_SKINFILES_DIR_ALREADY_EXISTS');
435- else error::note('_JP_SKINFILES_FILE_ALREADY_EXISTS');
434+ if (is_dir(_DIR_SKINS.$new_path)) jerror::note('_JP_SKINFILES_DIR_ALREADY_EXISTS');
435+ else jerror::note('_JP_SKINFILES_FILE_ALREADY_EXISTS');
436436 return;
437437 }
438438 if (@rename(_DIR_SKINS.self::$real_file_path,_DIR_SKINS.$new_path)) {
@@ -439,12 +439,12 @@
439439 core::set_cookie('note_text','_JP_SKINFILES_RENAMED',0);
440440 core::redirect_local('?padmin=jp_skinfiles&dir_path='.self::$dir_path.self::more_params());
441441 } else {
442- error::note('_JP_SKINFILES_RENAME_WAS_FAILED');
442+ jerror::note('_JP_SKINFILES_RENAME_WAS_FAILED');
443443 }
444444 }
445445 static public function action_post_delete(){
446446 if (!self::local_file_exists(_DIR_SKINS,self::$real_file_path)) {
447- error::note('_JP_SKINFILES_FILE_NOT_FOUND');
447+ jerror::note('_JP_SKINFILES_FILE_NOT_FOUND');
448448 return;
449449 }
450450 $path=_DIR_SKINS.self::$real_file_path;
@@ -452,13 +452,13 @@
452452 core::set_cookie('note_text','_JP_SKINFILES_DELETED',0);
453453 core::redirect_local('?padmin=jp_skinfiles&dir_path='.self::$dir_path.self::more_params());
454454 } else {
455- error::note('_JP_SKINFILES_DELETION_WAS_FAILED');
456- if (is_dir($path)) error::note('_JP_SKINFILES_CONFIRM_IF_EMPTY');
455+ jerror::note('_JP_SKINFILES_DELETION_WAS_FAILED');
456+ if (is_dir($path)) jerror::note('_JP_SKINFILES_CONFIRM_IF_EMPTY');
457457 }
458458 }
459459 static public function action_post_edit(){
460460 if (!self::local_file_exists(_DIR_SKINS,self::$real_file_path)) {
461- error::note('_JP_SKINFILES_FILE_NOT_FOUND');
461+ jerror::note('_JP_SKINFILES_FILE_NOT_FOUND');
462462 return;
463463 }
464464 if (file_put_contents(_DIR_SKINS.self::$real_file_path,$_POST['save_text'])) {
@@ -465,7 +465,7 @@
465465 core::set_cookie('note_text','_JP_SKINFILES_SAVED',0);
466466 core::redirect_local('?padmin=jp_skinfiles&dir_path='.self::$dir_path);
467467 } else {
468- error::note('_JP_SKINFILES_SAVING_WAS_FAILED');
468+ jerror::note('_JP_SKINFILES_SAVING_WAS_FAILED');
469469 }
470470 }
471471 }
\ No newline at end of file
Afficher sur ancien navigateur de dépôt.