vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   MD5 Encrypted Passwords (https://vborg.vbsupport.ru/showthread.php?t=23957)

creamy 08-17-2001 09:32 AM

um, i can't fix the last part on my own... maybe someone who knows php can help :)

when you tell it to mail you a password, its supposed to generate one from a list of words and mail that one and store it in the database. it's getting stuck on the easy part - opening the list of words.
the instructions say:
Quote:

Save the files "ppassgen.php", "encrypt_all_passwords.php", and "words.txt" to your VB "admin" directory.

You can use any word list to generate your random passwords, I used my system's /usr/dict/words. Just be sure to save your wordlist to "words.txt" in your "admin" directory.
well i did that, and i checked the chmod incase it matters, but even at 777 it doesn't work. i get this error instead:

Code:

Warning: fopen("words.txt","r") - No such file or directory in /home/mod-chi/public_html/admin/ppassgen.php on line 29

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 37

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 38

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 37

Warning: Supplied argument is not a valid File-Handle resource in /home/mod-chi/public_html/admin/ppassgen.php on line 38
(repeating forever)

the code in the first part of ppassgen.php is:

Code:

<?
/*
 * function ppassgen()
 * parameters:
 * $words = the name of the file w/ the words (one per line)
 *      or and array of words
 * $min = the minimum number of words per password
 * $max = the maximum number of words per password
 * $cutoff = the minimum number of characters per word
 * $sep = separator for the words in the password
 */

function ppassgen($words= "words.txt", $min=2, $max=4, $cutoff=5, $sep= "_") {

       
                // This is here for cases when we email a password from the admin control panel


    if(is_array($words)) {
        /* if we have passed and array of words, use it */
        $word_arr =  "words";
        /*
        while(list($k,$v) = each(${$word_arr})) {
            echo "$k $v<BR>";
        }
        */
    } else {
        /* read the external file into an array */
        $fp = fopen($words, "r");      <---------------------------- LINE 29

        if (!fp) {
            echo  "[ERROR}: Could not open file $words<BR>\n";
            exit;
        } else {
            /* assuming words of up to 127 characters */
            $word_arr =  "ext_arr";
            while(!feof($fp)) {            <---------------------------- LINE 37
                $tword = trim(fgets($fp,128)); <------------------- LINE 38


                /* check for minimum length and for exclusion of numbers */
                if ((strlen($tword) >= $cut_off) && !ereg( "[0-9]",$tword)) {
                    $ext_arr[] = strtolower($tword);
                }
            }
            fclose($fp);
        }
    }


i already tried the following:
not putting quotes around the filename
putting a full path to the words.txt
putting a relative path to words.txt

with no success....

pogo 08-17-2001 12:36 PM

The full path works fine for me
Code:

function ppassgen($words= "/full/path/to/words.txt", $min=2, $max=4, $cutoff=5, $sep= "_") {
Yeah, I should have complained about the wrong encrypt_all_pass... file.
And don't forget to check the mod panel index.php. I think you have to modify something there too.

creamy 08-17-2001 06:28 PM

hmm
i might not have put /users/ or whatever at the start of my path, i'll try again...
you know what's the most annoying? this file has code in it to detect if the file open failed, but it's not working

creamy 08-22-2001 06:07 AM

yeah the absolute path to the file works fine...
only problem i have now is when i go to the control panel i have to log in again... dunno if i'm smart enough to figure whats wrong (cookie problem?)
i hope the vbulletin dudes put this in the code soon, i hate hacking my board!

joecrow 08-24-2001 08:10 AM

does this work with vb 2.0.3 ?

pogo 08-24-2001 03:16 PM

yepp.

Raptor 08-24-2001 05:03 PM

it seems pogo had some problems

has the install file been updated with the correct details ?

Raptor 08-24-2001 05:47 PM

i have installed this following creamy/pogos changes and it works 100% perfect

thanks

CoffeeMugDude 08-27-2001 08:00 AM

Hi folks,

I've been on holiday, so this whole thread happened in my absence. Thanks for the feedback. Is anyone still struggling? Would it help if I updated the instructions for 2.0.3 ?

creamy 08-27-2001 08:36 AM

yeah that would probably help a lot... this is a kick-ass hack so keeping it updated is good :)
do you think there could be a problem somewhere? read my earlier post about it making me login again to get into he control panel - this is still happening. not a big problem but might as well fix it if possible.


All times are GMT. The time now is 01:46 AM.

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.00984 seconds
  • Memory Usage 1,740KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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