vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Advanced Warning System (AWS) (https://vborg.vbsupport.ru/showthread.php?t=71992)

Delphiprogrammi 03-02-2005 04:39 AM

Quote:

Originally Posted by Pickalo
Hey... I've been having some problems entering the data for warning types. Every time I try I get this error:


Thanks.

that's due to a bug in the code that's checks if those propertys are filled in properly to resolve that open the file admin_warn.php and find

PHP Code:

if ($warn_opts['allowoffpost']=='No' AND $_POST['warn_type']=='No')
    {
        
define('CP_REDIRECT''admin_warn.php?act=view');
        
print_stop_message('warning_warn_typeconflict');
    } 


after that add

PHP Code:

if(empty($_POST['warn_name']) OR trim($_POST['warn_name']) == '')
    {
        
print_stop_message('warning_warn_emptywarntype');
    }
    if(empty(
$_POST['warn_desc']) OR trim($_POST['warn_desc']) == '')
    {
        
print_stop_message('warning_warn_emptydesc');
    }
    if(empty(
$_POST['warn_points']) OR trim($_POST['warn_points']) == '')
    {
        
print_stop_message('warning_warn_emptypoints');
    }
    if(empty(
$_POST['warn_maturity']) OR trim($_POST['warn_maturity'])== '')
    {
        
print_stop_message('warning_warn_maturity');
    } 

i am verry sorry for making such a stupid mistake that code is mine John is innocent

sv1cec 03-02-2005 05:07 AM

Quote:

Originally Posted by Delphiprogrammi
that's due to a bug in the code that's checks if those propertys are filled in properly to resolve that open the file admin_warn.php and find

PHP Code:

if ($warn_opts['allowoffpost']=='No' AND $_POST['warn_type']=='No')
    {
        
define('CP_REDIRECT''admin_warn.php?act=view');
        
print_stop_message('warning_warn_typeconflict');
    } 


after that add

PHP Code:

if(empty($_POST['warn_name']) OR trim($_POST['warn_name']) == '')
    {
        
print_stop_message('warning_warn_emptywarntype');
    }
    if(empty(
$_POST['warn_desc']) OR trim($_POST['warn_desc']) == '')
    {
        
print_stop_message('warning_warn_emptydesc');
    }
    if(empty(
$_POST['warn_points']) OR trim($_POST['warn_points']) == '')
    {
        
print_stop_message('warning_warn_emptypoints');
    }
    if(empty(
$_POST['warn_maturity']) OR trim($_POST['warn_maturity'])== '')
    {
        
print_stop_message('warning_warn_maturity');
    } 

i am verry sorry for making such a stupid mistake that code is mine John is innocent

Delphi, the code you provide is not exactly correct, and since you want the checks, I guess we need to code them properly. The two first fields are character, so the trim function is necessary, the last two are numeric, so the check should be a little different, see below:

PHP Code:

if(empty($_POST['warn_name']) OR trim($_POST['warn_name']) == '')
    {
        
print_stop_message('warning_warn_emptywarntype');
    }
    if(empty(
$_POST['warn_desc']) OR trim($_POST['warn_desc']) == '')
    {
        
print_stop_message('warning_warn_emptydesc');
    }
    if(empty(
$_POST['warn_points']) OR $_POST['warn_points'] == '' OR $_POST['warn_points']<OR $_POST['warn_points']>99999)
    {
        
print_stop_message('warning_warn_emptypoints');
    }
       if(empty(
$_POST['warn_maturity']) OR $_POST['warn_maturity']=='' OR $_POST['warn_maturity']<OR $_POST['warn_maturity']>99999)
    {
        
print_stop_message('warning_warn_maturity');
    } 

If not, the user can enter a maturity of 'abcde' and the check will not stop him.

I've updated the zip file with this.

Rgds

Delphiprogrammi 03-02-2005 05:35 AM

Quote:

Originally Posted by sv1cec
Delphi, the code you provide is not exactly correct, and since you want the checks, I guess we need to code them properly. The two first fields are character, so the trim function is necessary, the last two are numeric, so the check should be a little different, see below:

PHP Code:

if(empty($_POST['warn_name']) OR trim($_POST['warn_name']) == '')
    {
        
print_stop_message('warning_warn_emptywarntype');
    }
    if(empty(
$_POST['warn_desc']) OR trim($_POST['warn_desc']) == '')
    {
        
print_stop_message('warning_warn_emptydesc');
    }
    if(empty(
$_POST['warn_points']) OR $_POST['warn_points'] == '' OR $_POST['warn_points']<OR $_POST['warn_points']>99999)
    {
        
print_stop_message('warning_warn_emptypoints');
    }
       if(empty(
$_POST['warn_maturity']) OR $_POST['warn_maturity']=='' OR $_POST['warn_maturity']<OR $_POST['warn_maturity']>99999)
    {
        
print_stop_message('warning_warn_maturity');
    } 

If not, the user can enter a maturity of 'abcde' and the check will not stop him.

I've updated the zip file with this.

Rgds


agreed daim i feel so ashamed stupid error :dead: :(

sv1cec 03-02-2005 06:00 AM

Quote:

Originally Posted by Delphiprogrammi
agreed daim i feel so ashamed stupid error :dead: :(

Don't worry about it, it was your fault, as much as mine. I didn't really check your code, when you posted it, I was way too busy to check it out, so I just included in the file. So we share the responsibility. LoL

Pickalo 03-02-2005 03:43 PM

Haha, thanks for the help guys :)

Kruppa 03-05-2005 11:22 AM

Hi, I have had this problem when I try to remove warnings (not the complete removal which still works) and haven't been able to resolve it. Can anyone help?




Database error in vBulletin 3.0.6:

Invalid SQL: update user set warning_level='0', warnings=1, warning_bans= where userid='6246'
mysql error: You have an error in your SQL syntax near 'where userid='6246'' at line 1

mysql error number: 1064


Script: admin_warn.php
Referer: admin_warn.php?act=remove&id=14&userid=6246&uname= Dhoffryn&wname=Flaming&postid=966742&ban=N&orderst ring=w.warned_time DESC

Thanks :)

Delphiprogrammi 03-05-2005 11:49 AM

warning_bans doesn't have a value edit your aws options (doesn't matter wich one) and save it again) that might help

Kruppa 03-05-2005 01:08 PM

Nope, hasn't done anything. :(

sv1cec 03-06-2005 05:32 AM

I cannot reproduce your problem, this is something I've tested several times. So I would suggest you upload the admin_warn.php file again.

Rgds

Kruppa 03-06-2005 12:09 PM

It's one of the first thing I tried. :D

If you can't reproduce the problem, it might be because it's confilcting with another hack I've recently installed. I'll keep looking.


All times are GMT. The time now is 04:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02025 seconds
  • Memory Usage 1,784KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete