Jump to content
  • Sign Up

Tutu

Rookie
  • Posts

    21
  • Joined

  • Last visited

Posts posted by Tutu

  1. I'm working on a 3rd party application, and I need to make a stand alone login authentication. I don't want to setup a session or create any local data vars of the sort, I just want to check the username/password for a match. The issue standing is that the XF authentication system doesn't make much sense to me. I've looked around the official XF website, but I haven't gathered much. I understand that password/salt data is stored in the `xf_user_authentication` table, but I don't know what to make of it. Would anyone be so kind as to explain to me how passwords are formed and what does what within this table?


    [uPDATE]

     

    I've been looking around and found that 'core12.php' (Library/XenForo/Authentication/Core12.php) is responsible for the XF login authentication. I've taken a look at it's contents, and this is the main authentication function,

    public function authenticate($userId, $password)
    {
        if (!is_string($password) || $password === '' || empty($this->_data))
    {
        return false;
    }
    
        $passwordHash = new XenForo_PasswordHash(XenForo_Application::getConfig()->passwordIterations, false);
        return $passwordHash->CheckPassword($password, $this->_data['hash']);
    }
    

    I'm wondering whether anyone knows how passwords are converted into authentication=>data=>hash

     

    [uPDATE]

     

    So I've found the hashing algo. in 'PasswordHash.php' (Library/XenForo/PasswordHash.php), and I've figured it would be much easier to just include the XF api. My question standing, is how to do so.

     

    ie; include( 'xf_main.php' )


    [uPDATE]

     

    Problem solved by using the REST api.

  2. Well, for some odd reason the IPB api makes all user-info besides their avatars easily accessible, and it was somewhat necessary for a 3rd party app. I was working on. Long story short, the following code snippet will allow you to easily grab a user's avatar location,

     

    connect.php

    <?php
    
        $mysql_hostname = '...';
        $mysql_user = '...';
        $mysql_password = '...';
        $mysql_database = '...';
        $prefix = "";
        $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die('Could not connect database');
        mysql_select_db($mysql_database, $bd) or die('Could not select database');
    ?>
    

    user.php

    class User {
        
        function avatar($user) {
            
            require_once('connect.php');
            try {
                
                $sql = "SELECT * FROM members WHERE name='$user'";
                $query = mysql_query($sql);
                if(!$query) {
                    exit('Fail');
                }
                $member = mysql_fetch_assoc($query);
                $id = $member['member_id'];
                
                $sql_2 = "SELECT * FROM profile_portal WHERE pp_member_id='$id'";
                $query = mysql_query($sql_2);
                $profile = mysql_fetch_assoc($query);
                $avatar = $profile['pp_main_photo'];
                if(!isset($avatar) || $avatar=='') {
                    exit('Fail');
                }
                exit('http://myforum.com/uploads/'.$avatar);
            } catch(Exception $ex){ 
                exit('Fail');
            }
        }
    }
    

    Usage,

    <?php
    
    $user = new User;
    $name = 'USERNAME';
    $user->avatar($name);
    
    • Upvote 1
  3. Download Topics Removed

    We've hidden the auto-generated download topics and their respective boards. The categories for IPB, XenForo, and vBulletin will now contain just two boards: support and tutorials. These auto-generated topics were cluttering up the forum and not useful at all. We've prohibited users from seeking support in those topics as it prevented individualized support for each user. Feedback was never really provided and most posts amounted to nothing more than spam. For those of you who liked to provide feedback in those topics, we've made this next adjustment for you...

     

    I completely agree with the download sections, but there should still be open sections for raw code/modifications. A link-back should also be created for each web-software or script specific category, the nav-bar is blatantly visible, but newbies will still probably miss it.

  4. I'm working on a small web-portal for my licensing system/software extension, and getting straight to the point I'm relatively new to web designing. That being said, I'm having trouble using the generic 'sticky footer' method, though it doesn't make much sense to me.

     

    The web portal can be found @ http://guard.neetgroup.net.

     

    I'm creating the portal using HTML, JS, & mainly PHP for the back-end. As for my actual code/css, it would be too much to explain, and I was wondering if anyone could mess around with FF's element/style modifier and work anything out. I'm also open to any suggestions concerning my code/design style, as I've already stated I'm relatively new to web designing.

     

    Thanks to anyone who tackles this in advance.

     

    Also, as a heads up, the I plan to clean up the login form and what not as soon as the footer issue is resolved.

  5. For some strange reason, the post-sharing/bookmark button/label generates an invalid URL.

    IE:

    website.com/index.php?/topic/1#entry35396-welcome/

    Is generated, where the URL should be,

    website.com/index.php?/topic/1-welcome/#entry35396

    fc9eb10180033cc83e165b377be15c57.png

     

    UPDATE

     

    Found the issue in the TopicView>Post template bit, and I 'fixed' it, but now it doesn't include the thread-page with the entry tag.

    An example being, this is what SHOULD be generated:

    website.com/index.php?/topic/1-welcome/page__st__120/#entry35396

    Instead I'm getting

    website.com/index.php?/topic/1-welcome/#entry35396
    
    

    This is my TopicView>Post template bit,

    ctrl + f and find 'bookmark'

    removed - solved
    
    
    

    UPDATE

    Solved my problem, I was missing an 'if' check for the page iD.

  6. Nothing really works.. When I click on arrows to expand in the ACP, nada happends.

    When I hover over a user, nothing appears (there should be a card).

    When I click on any dropdowns, it just adds '#' to the end of my browser's URL.

    Anything that runs/uses a script just doesn't work correctly..

     

    I really need some help here, my websites been offline for two weeks.

     

    [uPDATE]

     

    Turned out it was my server.

  7. This morning, when I awoke, I tried casually logging in to my forum, and then was hit with this dialog;

     

    6de850a32b2360c2164d1858d95a08cd.png

     

    So I became curious, seeing as to I was 1337% positive I'd included my username in the input field.

    I then tried again, and again, but the problem pursued.

     

    Out of curiousity, I tried logging into the ACP, and it worked just fine.

    Though all the text-field displays return raw HTML, rather than displaying the rich-text editor.

     

    I continued bug scouting, and then I received this dialog when trying to load my theme templates,

     

    c67fcb09a3973e23a6347f7b07aa397e.png

     

    Any ideas of what may be going on?

     

    UPDATE:

     

    I logged into my ACP today and saw this:

     

    http://gyazo.com/6c353ff41209f0342cbf98ef033f4d18

     

    My websites directory chmods are out of whack, though it certainly was not my doing.

     

  8. I think i had the same problem as this at one point, when doing edits in CSS and then saving them, on your site, press cntrl + F5 and it should do a hard refresh and that should work

     

    I've also tried this, but it doesn't seem to be working, for the time being I'll just export and re-import to test modifications.

    Thanks for the suggestions though, closing this thread.

  9. I've had this issue for a while now, basically if I revert the CSS template, changes are made immediately.

    Though if I just modify the already existing template, it takes days, at one point even two weeks to see them.

    It's not just myself, it's other members of the boards as well, and I cleaned my cookies/cache, even checked my tablet to make sure.

  10. Yes, the log only displayed ONE array including one package.

    I have two packages set up; Alpha & Beta, only one of them is logged when I make a transaction (last one in my cart).


    Alright, I THINK I understand what to do now, I just need some help actually getting data,

    
     Invoice 
    invoice Object
    (
        [data:invoice:private] => Array
            (
                [i_status] => pend
                [i_title] => BETA Tag, ALPHA Tag
                [i_member] => 1
                [i_items] => Array
                    (
                        [0] => Array
                            (
                                [act] => new
                                [app] => nexus
                                [type] => product
                                [cost] => 0
                                [tax] => 0
                                [renew_term] => 0
                                [renew_units] => 
                                [renew_cost] => 0
                                [quantity] => 1
                                [physical] => 
                                [shipping] => Array
                                    (
                                    )
    
                                [subscription] => 
                                [weight] => 0
                                [itemName] => BETA Tag
                                [itemID] => 8
                                [cfields] => Array
                                    (
                                    )
    
                                [opt_id] => 0
                                [groupRenewals] => 0
                                [methods] => Array
                                    (
                                    )
    
                                [_tax] => 0
                            )
    
                        [1] => Array
                            (
                                [act] => new
                                [app] => nexus
                                [type] => product
                                [cost] => 0
                                [tax] => 0
                                [renew_term] => 0
                                [renew_units] => 
                                [renew_cost] => 0
                                [quantity] => 1
                                [physical] => 
                                [shipping] => Array
                                    (
                                    )
    
                                [subscription] => 
                                [weight] => 0
                                [itemName] => ALPHA Tag
                                [itemID] => 9
                                [cfields] => Array
                                    (
                                    )
    
                                [opt_id] => 0
                                [groupRenewals] => 0
                                [methods] => Array
                                    (
                                    )
    
                                [_tax] => 0
                            )
    
                    )
    
                [i_total] => 0
                [i_date] => 1387402379
                [i_return_uri] => 
                [i_paid] => 0
                [i_status_extra] => a:1:{s:4:"type";s:4:"zero";}
                [i_discount] => 0
                [i_temp] => 
                [i_ordersteps] => 0
                [i_noreminder] => 1
                [i_renewal_ids] => Array
                    (
                    )
    
                [i_po] => 
                [i_notes] => 
                [i_shipaddress] => 
                [i_id] => 170
            )
    
        [customer] => customer Object
            (
                [data] => Array
                    (
                        ...
                    )
    
                [cardhandler:customer:private] => 
            )
    
        [takeAction] => 1
    )
    
    
    

    That's my invoice array with two items, I'd just like to know how to properly grab data from the sub array '[i_items]'.

    The following doesn't work,

    $invoice['i_items'][0]['itemName']
    
    

    Though, assuming I do use the invoice array to grab my item data, I still can't access a custom data-field I implemented into the package table in the db.


    UPDATE:

     

    Figured out why I CAN'T access invoice data, it's a private field.

    Which means I NEED to use the package array, but it's only returning ONE package..


    UPDATE:

     

    Turns out my Nexus I had installed was nulled/bugged.. Installed clean and the arrays are being posted as they should.

  11. Logged my invoice, because my $package parameter only contains one item,

    invoice Object
    (
        [data:invoice:private] => Array
            (
                [i_status] => pend
                [i_title] => BETA Tag
                [i_member] => 1
                [i_items] => Array
                    (
                        [0] => Array
                            (
                                [act] => new
                                [app] => nexus
                                [type] => product
                                [cost] => 0
                                [tax] => 0
                                [renew_term] => 0
                                [renew_units] => 
                                [renew_cost] => 0
                                [quantity] => 1
                                [physical] => 
                                [shipping] => Array
                                    (
                                    )
    
                                [subscription] => 
                                [weight] => 0
                                [itemName] => BETA Tag
                                [itemID] => 8
                                [cfields] => Array
                                    (
                                    )
    
                                [opt_id] => 0
                                [groupRenewals] => 0
                                [methods] => Array
                                    (
                                    )
    
                                [_tax] => 0
                            )
    
                    )
    
                [i_total] => 0
                [i_date] => 1387345380
                [i_return_uri] => 
                [i_paid] => 0
                [i_status_extra] => a:1:{s:4:"type";s:4:"zero";}
                [i_discount] => 0
                [i_temp] => 
                [i_ordersteps] => 0
                [i_noreminder] => 1
                [i_renewal_ids] => Array
                    (
                    )
    
                [i_po] => 
                [i_notes] => 
                [i_shipaddress] => 
                [i_id] => 159
            )
    

    With the provided, I can use a for loop like so,

    for ($i=0; $i<$invoice['quantity']; $i++) {
    
      //LOOP_FOR_EACH_ITEM
    
    }
    

    but how do I get data from EACH package?

     

    Like I stated, $package['...'] only contains data for the first item in the invoice.

    I also tried using a multi-dimensional array, but no luck,

     

    IE;

    $package['p_name'][0]
    

    Here's a package array with TWO items

    
     Package 
    Array
    (
        [p_id] => 9
        [p_name] => ALPHA Tag
        [p_seo_name] => alpha-tag
        [p_desc] => This is a test package
        [p_exp_days] => 
        [p_group] => 1
        [p_stock] => -1
        [p_reg] => 0
        [p_store] => 1
        [p_member_groups] => *
        [p_allow_upgrading] => 0
        [p_upgrade_charge] => 0
        [p_allow_downgrading] => 0
        [p_downgrade_refund] => 0
        [p_base_price] => 0.00
        [p_tax] => 0
        [p_renew_options] => a:0:{}
        [p_renewal_days] => 0
        [p_primary_group] => 0
        [p_secondary_group] => 
        [p_perm_set] => 
        [p_return_primary] => 1
        [p_return_secondary] => 1
        [p_return_perm] => 1
        [p_module] => subscribe
        [p_position] => 9
        [p_associable] => 
        [p_force_assoc] => 0
        [p_assoc_error] => 
        [p_discounts] => a:3:{s:7:"loyalty";a:0:{}s:6:"bundle";a:0:{}s:9:"usergroup";a:0:{}}
        [p_page] => 0
        [p_support] => 0
        [p_support_department] => 1
        [p_support_severity] => 0
        [p_featured] => 0
        [p_upsell] => 0
        [p_notify] => 
        [p_type] => product
        [p_custom] => 0
        [p_reviewable] => 1
        [p_review_moderate] => 0
        [p_image] => 
        [p_methods] => 
        [p_group_renewals] => 0
        [p_rebuild_thumb] => 0
        [id] => 9
        [p_physical] => 0
        [p_subscription] => 0
        [p_shipping] => 
        [p_weight] => 0
        [p_lkey] => 0
        [p_lkey_identifier] => 0
        [p_lkey_uses] => 0
        [p_locations] => 
        [p_exempt] => 
        [p_expire] => 
        [p_expire_unit] => 
        [p_max_height] => 
        [p_max_width] => 
        [p_queue] => 
        [p_quota] => 
        [p_ip] => 
        [p_cgi] => 
        [p_frontpage] => 
        [p_hasshell] => 
        [p_maxftp] => 
        [p_maxsql] => 
        [p_maxpop] => 
        [p_maxlst] => 
        [p_maxsub] => 
        [p_maxpark] => 
        [p_maxaddon] => 
        [p_bwlimit] => 
    )
    

    It only displays data for ONE package, as already stated.

  12. How do I count how many packages were purchased?

    I know I can call package data like so,

     

    public function onPaid( $member, $package, $invoice )
    {

       

        $package_name =$package['p_name']; //EXAMPLE
    }

     

    but how would I count packages in multiple were purchased, and retreive data from each one?

  13. Long story short, I want IP.Nexus to run a certain php script after anyone completes their purchase.

    I already know HOW to do so, I'd just like a better understanding of what data is actually posted to the provided page.

    /**
         * Item Purchased (run before onPurchaseGenerated)
         *
         * @param	array	The member purchasing
         * @param	array   Package data (combined array with row from nexus_packages and nexus_packages_*, depending on the package type)
         * @param	invoice	Invoice Model
         * @return	void
         */
        public function onPaid( $member, $package, $invoice )
        {
            
        }
    

    How does IP.Nexus post the package(s)? I know it posts an array with the package settings (or atleast I think), though how would I go about properly retreiving data? Also, how would I go about retreiving any data if someone purchased more than one package?

  14. You don't even need to be logged in, just going to the ACP index will auto login.

    Found the issue, someone messed with the loginauth script via the ftp server.. Fixed it all. Now to change all my server information .-.

  15. I don't know what's going on, I was grocery shopping and a friend texted me saying there were issues with the ACP.

    I got home to find that the ACP was AUTOMATICALLY logging in, under the usanem 'Admin', which doesn't exist.. I really need this bug fixed quickly.

     

    Posted Image

×
×
  • Create New...