News:

Wondering if this will always be free?  See why free is better.

Main Menu

Subaccounts

Started by SlammedDime, November 12, 2009, 09:59:09 AM

Previous topic - Next topic

SlammedDime

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...
                     

SlammedDime

Quote from: PalmBeachPreps on November 14, 2009, 11:08:45 AM
This is a great mod!  However, I'm getting an error on installation: 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...
                     

PalmBeachPreps

#42
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. 

makaluch

Quote from: makaluch on November 13, 2009, 10:40:55 AM
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:

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

ishy


SlammedDime

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:

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...
                     

Altair

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.

jibo

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?

ishy

Quote from: SlammedDime 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

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

kingkingston

A person might turn in to jekyll and hyde with this mod :P

Liam.

This mod will be brilliant for a schizophrenic forum! Hehe

Caltan

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?

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Eliana Tamerin

Quote from: Caltan 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?

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!

SlammedDime

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...
                     

Caltan

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.


Altair

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:



Quote from: Altair 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.

Caltan

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.

Eliana Tamerin

Quote from: Caltan 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.

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!

SlammedDime

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...
                     

Advertisement: