Phillip, to clarify, I think you are asking how to programmatically add
*JMC* users to JRun's pass.properties file, correct?

(If you mean to add users, groups, and roles for Web app users to
users.properties, then I think that is adequately described on pages 412-413
using the PropertyFileAuthentication class.)

The way that I currently do it from a java program is to use UnixCrypt to
create an encrypted password, store the encrypted password and the username
in a file. Then invoke PropertyScript to  read in that script file. There is
complete info on using PropertyScript in the Advanced Configuration Guide at
the bottom of http://www.allaire.com/developer/documentation/JRun.cfm.

Here's some relevant code:

import allaire.jrun.install.*;  //for PropertyScript
import allaire.jrun.util.*;     //for UnixCrypt

private static final char c = File.separatorChar;

String username = "nick";
String password = "nickspassword";
String encryptedpassword = UnixCrypt.crypt(password);
String servername = "newserver";

...write the location pass.properties, username and encryptedpassword to a
scriptfile (shown below) using something like:
        fileout.println("file " + jrunrootdir + c + "lib" + c +
"pass.properties");
        fileout.println("  add password.login." + username + " " +
encryptedpassword);
        fileout.println("  add permission.login." + username + " " +
servername);

... set propfile to the location of the pass.properties file:
String propfile = (jrunrootdir + c + lib + "pass.properties");
PropertyScript ps = new PropertyScript();
ps.executeScript(scriptfile, propfile);

Sample scriptfile:
file c:\progra~1\allaire\jrun\lib\pass.properties
  add password.login.nick nIIj5sYMsBsoM
  add permission.login.nick newserver

Hope this helps!

  >>-----Original Message-----
  >>From: Rhodes, Phillip C. [mailto:[EMAIL PROTECTED]]
  >>Sent: Thursday, October 05, 2000 2:51 PM
  >>To: JRun-Talk
  >>Subject: How do I programmatically add user to JRun?
  >>
  >>
  >>On page 412 of developing apps with JRun, it talks about 
  >>programmatically
  >>adding users to the JRun user manager.  How would I do this?
  >>
  >>By this, I mean having JRun use its own property files to store user
  >>information and authenticate users.
  >>
  >>Thanks,
  >>Phillip
  >>
  >>
  >>Phillip Rhodes
  >>[EMAIL PROTECTED]
  >>Alcoa eCommerce
  >>https://www.ALCOADIRECT.COM
  >>826B Two Allegheny Center Pittsburgh, PA  15212
  >>(412) 553-4900  (phone)  (412) 553-2484 (fax)
  >>
  >>------------------------------------------------------------
  >>------------------
  >>Archives: http://www.egroups.com/group/jrun-interest/
  >>Unsubscribe: 
  >>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=li
  >>sts/jrun_talk
  >>or send a message to [EMAIL PROTECTED] 
  >>with 'unsubscribe' in the body.
  >>
------------------------------------------------------------------------------
Archives: http://www.egroups.com/group/jrun-interest/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/jrun_talk
or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the 
body.

Reply via email to