Posts

Showing posts from 2009

Upload user specific images in FCK Editor of DNN

Question: I would like to be able to let users upload their pictures through the editor "FCKConfig.ImageUpload=true" but i want each user that logs in to be able to upload to their assigned areas for instance, if user1 logs in then when he uploads a picture he would upload it to the user1 in the web server and then when he browses for all pictures using fckeditor he would only be able to see the pictures under the user1 folder. Answer: If you want to be able to set the file browsing and uploading path on the fly for each user or group you will have to use the Application("FCKeditor:UserFilesPath") variable for FCKeditor on the Page_Init event. You can also use the Session("FCKeditor:UserFilesPath"), as a matter of fact, that is what the fckeditor documentation suggests. However, with dotnetnuke i couldnt get it to work properly using the session variable so instead I used the "Application" call, i think that this is the equivalent of using the we

Urdu textbox JS file

Download js file directly. http://justcsharp.googlepages.com/urdueditor.js

Urdu Textbox

JS file : http://justcsharp.googlepages.com/urdueditor.js Editor Initialization : Initialize Editor before textbox. initUrduEditor(""); TextBox : input type="text" onfocus="setEditor(this)" style="font-family: Urdu Naskh Asiatype; font-size: 14px;" id="Editor" name="Editor" lang="ur"

Restrict Web Page access based on MAC / IP

This solution is a combination of .Net / Java applets. Java Applet is used to get the MAC from the client machine and then it is sent back to the server and there it will be used to restrict the client access or grant it access based on the ACL (Access Control List) defined in the XML. Java Applet to Get MAC Address : import java.net.NetworkInterface; import java.net.SocketException; import java.util.Enumeration; import java.util.ArrayList; import java.applet.Applet; public class MacAddressApplet extends Applet { public static String sep = ":"; public static String format = "%02X"; /** * getMacAddress - return the first mac address found * separator - byte seperator default ":" * format - byte formatter default "%02X" * * @param ni - the network interface * @return String - the mac address as a string * @throws SocketException - pass it on */ public static String macToString( NetworkInterface ni ) throws SocketException { return macToString( ni,