Advertisement:

Author Topic: Subaccounts  (Read 187704 times)

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,276
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
Re: Subaccounts
« Reply #40 on: November 14, 2009, 06:22:59 PM »
unlikely ishy... i'll need to see the index.template.php that you've tried to modify to see what is missing.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,276
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
Re: Subaccounts
« Reply #41 on: November 14, 2009, 06:26:29 PM »
This is a great mod!  However, I'm getting an error on installation:
Code: [Select]
2.  Replace  ./Themes/default/Display.template.php  Test failed.

I went to correct that part manually, and found out that the problem is that the code which is supposed to be replaced is not entirely the same.  Should I just add the edits after it which actually change everything?

Display template is attached.
It's because of the WYSIWYG editor you installed.  Use this edit instead...
Code: (Find) [Select]
<div id="qr_buttons">
Code: (Replace) [Select]
<div id="qr_buttons">';
if (!empty($user_info['subaccounts']))
{
echo '
<strong>', $txt['use_subaccount'], ':</strong> <select name="subaccount">
<option value="', $user_info['id'], '" selected="selected">', $user_info['name'], '</option>';
foreach($user_info['subaccounts'] as $account)
echo '
<option value="', $account['id'], '">', $account['name'], '</option>';
echo '
</select>';
}

echo '
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline PalmBeachPreps

  • Jr. Member
  • **
  • Posts: 169
  • Gender: Male
    • Palm Beach Preps
Re: Subaccounts
« Reply #42 on: November 14, 2009, 07:31:40 PM »
Thanks SlammedDime!

EDIT: One last issue (I hope  ;)) : when I switch to my sub-account, there is no drop-down for me to switch back. 
« Last Edit: November 14, 2009, 07:41:37 PM by PalmBeachPreps »

Offline makaluch

  • Newbie
  • *
  • Posts: 7
Re: Subaccounts
« Reply #43 on: November 14, 2009, 08:25:46 PM »
Test installation flagged these errors:

in ./Sources/Profile-Modify.php (0777) Execute modification failed > replace failed, add before successful

Files are configured (via SMF admin panel) to replace files with trailing tildas like 'filename.php~'

Any advice or info?
-------------------------------------------------------------------
...
Account function:

Code: [Select]
function account($memID)
{
global $context, $txt;

loadThemeOptions($memID);
if (allowedTo(array('profile_identity_own', 'profile_identity_any')))

loadCustomFields($memID, 'account');



// Login Security
$allowedips = '';
global $modSettings;
if ($modSettings['ls_allow_ip_security'])
{
global $smcFunc;
$dbresult = $smcFunc['db_query']('',"
SELECT
allowedips
FROM {db_prefix}login_security
WHERE ID_MEMBER = " . $memID);
$numRows = $smcFunc['db_num_rows']($dbresult);
// We are not going to do anything since they don't have any settings defined
if ($numRows != 0)
{

$ipRow = $smcFunc['db_fetch_assoc']($dbresult);
$allowedips = $ipRow['allowedips'];
}
$smcFunc['db_free_result']($dbresult);

$context['allowedips'] = $allowedips;

}


// End Login Security



$context['sub_template'] = 'edit_options';
$context['page_desc'] = $txt['account_info'];

setupProfileContext(
array(
'member_name', 'real_name', 'date_registered', 'posts', 'lngfile', 'hr',
'id_group', 'hr',
'email_address', 'hide_email', 'show_online', 'hr',
'passwrd1', 'passwrd2', 'hr',
'secret_question', 'secret_answer',
)
);
}

Do you guys need more info to point me in the right direction? I'd really love to manage my forums with this amazing tool.

PeninsulaRC.com

Offline ishy

  • Jr. Member
  • **
  • Posts: 241
  • Gender: Female
Re: Subaccounts
« Reply #44 on: November 14, 2009, 10:15:29 PM »
Here it is...thanks!

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,276
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
Re: Subaccounts
« Reply #45 on: November 15, 2009, 12:37:54 AM »
ishy - you forgot to add $user_info and $scripturl to the global declaration on your template_init function.  See the very first edit for index.template.php

makaluch - try this function:

Code: [Select]
function account($memID)
{
   global $context, $txt, $cur_profile;

   loadThemeOptions($memID);
   if (allowedTo(array('profile_identity_own', 'profile_identity_any')))
     
      loadCustomFields($memID, 'account');
     
     
     
      // Login Security
      $allowedips = '';
      global $modSettings;
      if ($modSettings['ls_allow_ip_security'])
      {
         global $smcFunc;
         $dbresult = $smcFunc['db_query']('',"
         SELECT
            allowedips
         FROM {db_prefix}login_security
         WHERE ID_MEMBER = " . $memID);
         $numRows = $smcFunc['db_num_rows']($dbresult);
         // We are not going to do anything since they don't have any settings defined
         if ($numRows != 0)
         {
           
            $ipRow = $smcFunc['db_fetch_assoc']($dbresult);
            $allowedips = $ipRow['allowedips'];
         }
         $smcFunc['db_free_result']($dbresult);
         
         $context['allowedips'] = $allowedips;
         
      }
     
     
      // End Login Security
     
     

   $context['sub_template'] = 'edit_options';
   $context['page_desc'] = $txt['account_info'];

$profileContext = array('member_name', 'real_name', 'date_registered', 'posts', 'lngfile', 'hr', 'id_group', 'hr',);
$profileContext = array_merge($profileContext, empty($cur_profile['id_parent']) ?
array(
'email_address', 'hide_email', 'show_online', 'hr',
'passwrd1', 'passwrd2', 'hr',
'secret_question', 'secret_answer') :
array('hide_email', 'show_online', 'hr',
'passwrd1', 'passwrd2', 'hr',));

setupProfileContext($profileContext);
}
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline Altair

  • Jr. Member
  • **
  • Posts: 245
Re: Subaccounts
« Reply #46 on: November 15, 2009, 12:58:54 AM »
Hey Slammed. Would it be possible for you to help me Mod a Theme Aaron Made. I use it as my Default Skin. It's a bit... different.

Link: http://custom.simplemachines.org/themes/index.php?lemma=336

What do you think the best way to modify this theme would be?

Also, thank you SO much for making this Mod. I will be sure to Donate when I can find the funds.

Offline jibo

  • Semi-Newbie
  • *
  • Posts: 17
Re: Subaccounts
« Reply #47 on: November 15, 2009, 06:22:56 AM »
Is it possible to show in the postinformation the name of the master account?

Subbaccount 1
posted by: "name of master account"
Am i clear?

Offline ishy

  • Jr. Member
  • **
  • Posts: 241
  • Gender: Female
Re: Subaccounts
« Reply #48 on: November 15, 2009, 10:00:19 AM »
ishy - you forgot to add $user_info and $scripturl to the global declaration on your template_init function.  See the very first edit for index.template.php

I was sure I had done that, but maybe I did it for the other themes, and missed that one somehow. Thanks!

Offline kingkingston

  • Full Member
  • ***
  • Posts: 651
  • Gender: Male
Re: Subaccounts
« Reply #49 on: November 15, 2009, 01:12:33 PM »
A person might turn in to jekyll and hyde with this mod :P

Offline Liam.

  • SMF Hero
  • ******
  • Posts: 2,239
  • Gender: Male
Re: Subaccounts
« Reply #50 on: November 15, 2009, 03:27:07 PM »
This mod will be brilliant for a schizophrenic forum! Hehe

Offline Caltan

  • Semi-Newbie
  • *
  • Posts: 72
    • RP Resources
Re: Subaccounts
« Reply #51 on: November 16, 2009, 11:00:41 AM »
With beta3.1 and Aliases, any alias could modify a post made by any other alias under the same parent account.  With Subaccounts, this is not the case: only the original author account can edit the post.  This isn't a deal-breaker by any means, but it is annoying; if you've fat-fingered an edit and accidentally switched post attribution to a different account, you have to switch to that account to modify.  Is there a security reason why it's missing, or was it just not deemed necessary?

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: Subaccounts
« Reply #52 on: November 16, 2009, 12:00:20 PM »
intersting
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,612
  • Gender: Female
Re: Subaccounts
« Reply #53 on: November 16, 2009, 01:33:02 PM »
With beta3.1 and Aliases, any alias could modify a post made by any other alias under the same parent account.  With Subaccounts, this is not the case: only the original author account can edit the post.  This isn't a deal-breaker by any means, but it is annoying; if you've fat-fingered an edit and accidentally switched post attribution to a different account, you have to switch to that account to modify.  Is there a security reason why it's missing, or was it just not deemed necessary?

As I remember it, it was the amount of edits necessary and the overhead load that it took to do this. I think it's a nice idea, but if the account switcher is present on every page, it takes just two clicks to modify the post. IMO, not a big deal.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,276
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
Re: Subaccounts
« Reply #54 on: November 16, 2009, 04:09:33 PM »
As Eliana said, the number of edits to make all of that possible was enormous... and could have possibly made the mod that much more difficult to support.  With the ease of switching accounts and remaining on the same page after the switch, it makes it fairly easy to switch accounts then edit the post.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Offline Caltan

  • Semi-Newbie
  • *
  • Posts: 72
    • RP Resources
Re: Subaccounts
« Reply #55 on: November 16, 2009, 05:34:46 PM »
Like I said: not a deal-breaker, just annoying; we'll get used to it, it's cool.  I completely understand too much overhead!  I just wanted to make sure there wasn't an option I was missing somewhere.


Offline Altair

  • Jr. Member
  • **
  • Posts: 245
Re: Subaccounts
« Reply #56 on: November 17, 2009, 01:30:11 AM »
Just wanted to make a bit of a note.

Sharing a SubAccount is a bit of a risk, it seems. Apparently, the other user can change the password and/or delete the account itself. Is there some measure against this, or is it like this intentionally?

And to make sure my other post doesn't get lost, a quoted post:



Hey Slammed. Would it be possible for you to help me Mod a Theme Aaron Made. I use it as my Default Skin. It's a bit... different.

Link: http://custom.simplemachines.org/themes/index.php?lemma=336

What do you think the best way to modify this theme would be?

Also, thank you SO much for making this Mod. I will be sure to Donate when I can find the funds.

Offline Caltan

  • Semi-Newbie
  • *
  • Posts: 72
    • RP Resources
Re: Subaccounts
« Reply #57 on: November 17, 2009, 08:29:33 AM »
Bug: when an admin or mod with subaccounts edits another user's post, the post is given the admin's attribution.  Subsequent edits have the admin's subaccount dropdown.

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,612
  • Gender: Female
Re: Subaccounts
« Reply #58 on: November 17, 2009, 08:43:29 AM »
Bug: when an admin or mod with subaccounts edits another user's post, the post is given the admin's attribution.  Subsequent edits have the admin's subaccount dropdown.

Using Quick Edit or Modify?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Offline SlammedDime

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,276
  • School of Air Ride
    • matt.zuba on Facebook
    • @mattzuba on Twitter
Re: Subaccounts
« Reply #59 on: November 17, 2009, 04:46:06 PM »
Altair - as for the theme, it may be quite a bit of work, when I have some free time I'll see if I can work on it.  As for the shared account thing, I could have sworn that I made it so that only the original owner could delete the subaccount.  I'll have to take a look at that.

Caltan - I specifically made a unit test for that situation and it passed... I actually did 16 different situations and the code logic passed all of them... can you answer eliana's question on the Quick Edit or normal Modify?
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...