close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

upload to specific user folder - CHot

Thread began 1/03/2012 5:22 pm by jo271221 | Last modified 2/09/2012 5:11 pm by Jason Byrnes | 1072 views | 9 replies |

jo271221

upload to specific user folder - CHot Post

I want to upload to a directory # that corresponds to the id in my user table. We are doing this on a couple other sites, but I obviously did not make very good notes. I have attached the update, insert and some KFM files.

Attached Files
__WA-Post.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the configuration.php file is the file that sets the upload directory.

you have the following code that is using the $_SESSION['userid']; variable:

php:
if (isset($_SESSION['userid'])) {

    $kfm_userfiles_address .= "/".$_SESSION['userid'];



forst, double check that userid is the correct session name to be using. Open the login page, double click the Authenticate user server behavior and go to the third page to check the name of the id session that is created.

next, try changing the code in the configuration.php page to:

php:
@session_start();

if (isset($_SESSION['userid'])) {
    $kfm_userfiles_address .= "/".$_SESSION['userid'];
Sign in to reply to this post

jo271221

2 Log Ins Users and CMS/ Upload to user folder

I tried that and it was unsuccessful, but I have a complication. We are working on a site that has been established for over 15 years and has a member directory, currently that is the main users table. Then I added powercms not thinking that now I have 2 user tables and 2 log in pages AND the initial log in page has been modified with some hand coding. I am wondering what the best way to proceed is. Do I keep to log in and somehow another helper rules file or what? I want to the history feature to work in the CMS, I want to use the rules of if the user is logged into directory, if the user has access level 10 in the directory (or I guess we could change this to admin in PowerCMS), and if the user id matches the customerid in the update record. Thank you in advance.

Attached Files
__webassistLogIn_UserUpload.zip
Sign in to reply to this post

Jason ByrnesWebAssist

your login script is set to create a session named directoryid, it does not create a userid session, so you will need to edit the code to use the directoryid session instead.


to add additional users to the power CMS system, it checks to make sure that the UserGroupID session variable is equal to 1



you would need to add a UserGroup column to your users table. for users that should access the CMS admin panel, set that column to 1 for users that should not, set it to 0

and edit the login behavior to set the UserGroupID session variable using the UserGroup column.

Sign in to reply to this post

jo271221

2 log in pages or 1

I am confused. Am I suppose to keep 2 log in pages? 1 for CMS and 1 for the features the public that was existing? Or do I add a column to my tbl_directorylistings (1) which is the original users table and add a column UserGroup to that table? If so, how would the powerCMS know to check that table - because of the log in being edited (2)?

1. you would need to add a UserGroup column to your users table. for users that should access the CMS admin panel, set that column to 1 for users that should not, set it to 0

2. and edit the login behavior to set the UserGroupID session variable using the UserGroup column.

Is the configuration file the file that needs to be changed from userid to directoryid? Example
@session_start();
if (isset($_SESSION['directoryid'])) {
$kfm_userfiles_address .= "/".$_SESSION['directoryid'];

Thank You!

Sign in to reply to this post

Jason ByrnesWebAssist

1) I guess i'm not clear what you are trying to accomplish. I sounded like you wanted to grant users loging in using the standard login page access to the cms admin panel?

you could do that using the steps I outlined, you would still need to use the regular CMS login page to grant access to the super admin though.

2) yes, that is the code that needs to be changed.

Sign in to reply to this post

jo271221

2 log ins

I want to allow our general members to be able to log in and edit the site AND also web admins to log in to use the CMS. Whatever method is the easiest and most sensible.
If the CMS admin_cms/user_login and Accounts/login can both be used on the same site and not conflict that is great, but I am unclear about that. I assume if we do it that way then there is no need to modify the tbl_directorylistings table with the column UserGroup. I think maybe I just need help with the Security Assist helper rules files. Basically I just need to allow the webadmin log in access to work and all the show if rules and log in permissions to work related to the accounts/login. I hope this makes sense. Thanks,

Sign in to reply to this post

Jason ByrnesWebAssist

if you want general users to be able to login and access the CMS admin, then you need to edit the users table to have the UserGroupID column and modify the login page to set the UserGroupID session variable. it is the UserGroupID session variable that is used to allow or deny access to the cms admin.

Sign in to reply to this post

jo271221

upload file manager not working

Now the file manager just sits and nothing happens, here is what I have in the config file:
$use_kfm_security = false;
$kfm_userfiles_address = '../../userfiles';
@session_start();
if (isset($_SESSION['directoryid'])) {
$kfm_userfiles_address .= "/".$_SESSION['directoryid'];
if (!file_exists($kfm_userfiles_address)) {
mkdir($kfm_userfiles_address);
chmod($kfm_userfiles_address,0777);
}
}
if (isset($_SESSION['useOverrideRoot'])) {
$kfm_userfiles_address = abs2rel($_SESSION['useOverrideRoot'],dirname(__FILE__));
}

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...