dbSiteUser.cs code change.

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
12/10/2012 12:06:13 PM
Gravatar
Total Posts 24

dbSiteUser.cs code change.

I made a small change to the sbSiteUser.cs to shell a batch script to add a new user to my VSFTP site on a separate linux server using plink and adduer.sh within the .bat.  The code would only run when someone registers a new user id.

I've tested and debugged the small additional code using the latest download from TortoiseHg.  Everything works fine in VS2010, but as SOON as I copy the .dll into the bin directory on the web site, 2.3.9.3, the mojo error page is displayed instead of the normal home page.

Do I have to redeploy the entire set of projects just to update a single .dll onto the latest stable distribution, (.zip)?  Or is there somewhere I can find what the issue is?  Should I also update the log4net.dll? (I noticed that there was a problem with the version being out of sync in the refrence right off the bat that needed to be corrected.... 12.10 vs. 12.11 I believe)

Thanks,

Carl

 

12/10/2012 12:29:28 PM
Gravatar
Total Posts 24

Re: dbSiteUser.cs code change.

Incidently, there is no error for another .dll I added, (just recompiled from the original source) -- mojoportal.Net.dll.

Thanks,

Carl

12/10/2012 12:37:41 PM
Gravatar
Total Posts 24

Re: dbSiteUser.cs code change.

And, just recompiling and replacing the log4net.dll and starting the http://mojohomepage.com/setup/default.aspx gives the same error as I had before:


 

We're sorry but a server error has occurred while trying to process your request.

The error has been logged and will be reviewed by our staff as soon as possible. It is possible that the error was just a momentary hiccup and you may wish to use the back button and try again or go back to the home page.

 

12/10/2012 12:38:30 PM
Gravatar
Total Posts 18439

Re: dbSiteUser.cs code change.

Hi Carl,

There have been lots of changes since version 2.3.9.3. You should deploy all the files not just the dlls.

Also I do not recommend modifying the mojoPortal source code, any custom code should be in your own projects, forking the mojoPortal source code is a bad idea.

For what you are doing you should instead implement and plugin a custom user registered event handler. This can be done with no modifications to mojoPortal soruce code.

Best,

Joe

12/10/2012 2:43:13 PM
Gravatar
Total Posts 24

Re: dbSiteUser.cs code change.

Thanks Joe, It would be a very small project indeed.  I'll check out the link on how to do that and still use all of the user information typed into the registration page as well as having it envoked using the Create Account button.  The main point is I needed the verified username and password and for this information to be provided just after the account was created in the SQL database.  I could run my own query of the table outside, but prefer to have this code run just AFTER the user id and password are registered in the database.

Here are the 7 lines of code that gets run in the AddUser method just before return newID; within the DBSiteUser class defined in the dbSiteUser.cs file.

System.Diagnostics.Process proc = new System.Diagnostics.Process();

proc.EnableRaisingEvents = false;

proc.StartInfo.FileName = "batch_path_and_batch_file_name";

proc.StartInfo.Arguments = loginName +" " + password;  //These are the two variables needed from the code above

proc.StartInfo.CreateNoWindow =true;

proc.StartInfo.UseShellExecute = false;

proc.Start();

You must sign in to post in the forums. This thread is closed to new posts.