From c5bdf98fd36b754d36f29a3210d4710514e38597 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Sun, 27 Dec 2009 14:02:36 +0100 Subject: build: fix log4j dependency of PGSqlAuthPlugin - path to log4j has to be set in manifest file Signed-off-by: Manuel Traut --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index f38dccc..a4876fb 100644 --- a/build.xml +++ b/build.xml @@ -139,7 +139,7 @@ - + -- cgit v1.2.3 From b794b9e4f98fc8ed1809953d9303b219d5aebc1d Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Sun, 27 Dec 2009 14:21:13 +0100 Subject: startup: cleanup startup scripts - remove scripts for each jar file - start-java.sh introtuced - apps can now be started by e.g. ./start-java.sh yalpPGSqlAuth.jar Signed-off-by: Manuel Traut --- auth.sh | 1 - client.sh | 7 ------- input.sh | 1 - output.sh | 1 - server.policy | 1 + server.sh | 7 +++++-- src/YalpAuth/YalpPGSqlAuth/YalpPGSqlAuth.java | 2 +- start-java.sh | 8 ++++++++ 8 files changed, 15 insertions(+), 13 deletions(-) delete mode 100755 auth.sh delete mode 100755 client.sh delete mode 100755 input.sh delete mode 100755 output.sh create mode 100755 start-java.sh diff --git a/auth.sh b/auth.sh deleted file mode 100755 index dd0fe2f..0000000 --- a/auth.sh +++ /dev/null @@ -1 +0,0 @@ -java -Djava.library.path=./lib -jar yalpPGSqlAuth.jar -ORBInitialPort 1050 -ORBInitialHost localhost diff --git a/client.sh b/client.sh deleted file mode 100755 index e8adf20..0000000 --- a/client.sh +++ /dev/null @@ -1,7 +0,0 @@ -export LD_LIBRARY_PATH=/usr/lib/jni -CLASSPATH=/usr/share/java/swt.jar -java -Dswt.library.path=/usr/lib/jni \ --Djava.library.path=/usr/share/java -jar yalpSWTClient.jar \ --cp /usr/share/java/swt-gtk-3.4.jar \ --ORBInitialPort 1050 -ORBInitialHost localhost \ --ORBInitRef NameService=corbaloc:iiop:localhost:1050/NameService diff --git a/input.sh b/input.sh deleted file mode 100755 index b77419f..0000000 --- a/input.sh +++ /dev/null @@ -1 +0,0 @@ -java -Djava.library.path=./lib -jar yalpPGSqlInput.jar -ORBInitialPort 1050 -ORBInitialHost localhost diff --git a/output.sh b/output.sh deleted file mode 100755 index cdad4fd..0000000 --- a/output.sh +++ /dev/null @@ -1 +0,0 @@ -java -Djava.library.path=./lib -jar yalpVlcTelnetOutput.jar -ORBInitialPort 1050 -ORBInitialHost localhost diff --git a/server.policy b/server.policy index e07e45d..a7bb177 100644 --- a/server.policy +++ b/server.policy @@ -3,6 +3,7 @@ grant { permission java.io.FilePermission "C:\\Programme\\VideoLAN\\VLC\\vlc","execute"; permission java.io.FilePermission "/Applications/VLC.app/Contents/MacOS/VLC","execute"; permission java.net.SocketPermission "*:1024-","connect,accept,resolve"; + permission java.net.SocketPermission "localhost:1050","connect,accept,resolve"; permission java.util.PropertyPermission "id3.default_language", "read"; permission java.util.PropertyPermission "id3.default_encoding", "read"; }; diff --git a/server.sh b/server.sh index bb38d65..66cd5fd 100755 --- a/server.sh +++ b/server.sh @@ -1,4 +1,7 @@ -/usr/bin/orbd -ORBInitialPort 1050 & +/usr/bin/orbd \ +-J-Djava.net.preferIPv4Stack=true \ +-J-Dorg.omg.CORBA.ORBInitialHost=127.0.0.1 \ +-ORBInitialPort 1050 -ORBInitialHost 127.0.0.1 & sleep 4 -java -Djava.library.path=./lib -jar yalpServer.jar -ORBInitialPort 1050 -ORBInitialHost localhost +./start-java.sh yalpServer.jar killall -9 orbd diff --git a/src/YalpAuth/YalpPGSqlAuth/YalpPGSqlAuth.java b/src/YalpAuth/YalpPGSqlAuth/YalpPGSqlAuth.java index 676fe3c..d497c3d 100644 --- a/src/YalpAuth/YalpPGSqlAuth/YalpPGSqlAuth.java +++ b/src/YalpAuth/YalpPGSqlAuth/YalpPGSqlAuth.java @@ -22,7 +22,7 @@ import YalpInterfaces.*; */ public class YalpPGSqlAuth { - private YalpAuthInterfaceImpl con; + private YalpAuthPluginImpl con; private DatabaseDefines config; public static void main(String[] args) diff --git a/start-java.sh b/start-java.sh new file mode 100755 index 0000000..9652578 --- /dev/null +++ b/start-java.sh @@ -0,0 +1,8 @@ +java \ +-Djava.net.preferIPv4Stack=true \ +-Dorg.omg.CORBA.ORBInitialHost=127.0.0.1 \ +-Djava.library.path=./lib \ +-jar $@ \ +-ORBInitialPort 1050 -ORBInitialHost 127.0.0.1 \ +-ORBInitRef NameService=corbaloc:iiop:127.0.0.1:1050/NameService \ +-ORBDottedDecimalAddresses 1 -- cgit v1.2.3 From 718a520c0faa92a357d0fb11e89ff4ea28bc63a3 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Sun, 27 Dec 2009 16:32:21 +0100 Subject: build: fix CR/LF Signed-off-by: Manuel Traut --- build.xml | 464 +++++++++++++++++++++++++++++++------------------------------- 1 file changed, 231 insertions(+), 233 deletions(-) diff --git a/build.xml b/build.xml index 1777a52..e17faf0 100644 --- a/build.xml +++ b/build.xml @@ -1,235 +1,234 @@ -<<<<<<< HEAD - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Doing all - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Doing all + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ======= @@ -462,4 +461,3 @@ ->>>>>>> c62ff958823168d7622b397609220db8b67fa731 -- cgit v1.2.3 From 4a1cbbae8c3362b35ef828179b36b6bb650ae1a5 Mon Sep 17 00:00:00 2001 From: Nicole Vreden Date: Sun, 27 Dec 2009 18:36:05 +0100 Subject: Python-Elementary: List Example - List and Video Signed-off-by: Nicole Vreden --- src/YalpClients/EflClient/list_test.edc | 50 +++++++++++++++++++++++++ src/YalpClients/EflClient/list_test_elem.py | 57 +++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 src/YalpClients/EflClient/list_test.edc create mode 100644 src/YalpClients/EflClient/list_test_elem.py diff --git a/src/YalpClients/EflClient/list_test.edc b/src/YalpClients/EflClient/list_test.edc new file mode 100644 index 0000000..f3b42e0 --- /dev/null +++ b/src/YalpClients/EflClient/list_test.edc @@ -0,0 +1,50 @@ +collections +{ + group + { + name: "list"; + parts + { + part + { + name: "main"; + type: RECT; + mouse_events: 0; + description + { + state:"default" 0.0; + rel1 + { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 + { + relative: 1.0 1.0; + offset: 0 0; + } + } + } + part + { + name: "video"; + type: SWALLOW; + description + { + state: "default"0.0; + aspect: 1.7 1.8; + rel1 + { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 + { + relative: 1.0 1.0; + offset: 0 0; + } + } + } + } + } +} diff --git a/src/YalpClients/EflClient/list_test_elem.py b/src/YalpClients/EflClient/list_test_elem.py new file mode 100644 index 0000000..a3fcc91 --- /dev/null +++ b/src/YalpClients/EflClient/list_test_elem.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +import edje +import ecore.evas +import sys +import os +import ecore +import emotion +import evas +import elementary + +def huhu(obj, it): + print "guck guck"; + +elementary.init() +win = elementary.Window("test", elementary.ELM_WIN_BASIC); + +edje_file = os.path.join(os.path.dirname(sys.argv[0]),"list_test.edj") +c = edje.Edje(win.canvas,file=edje_file,group="list") + +vid = emotion.Emotion(win.canvas,module_filename="xine"); +vid.file_set("/home/manut/Videos/2009-2.avi"); + +c.part_swallow("video", vid) + +vid.resize(80,60); +vid.show(); +vid.play = True; + +items = [("huhu",huhu), + ("haha", huhu), + ("hoho", huhu), + ("hehe", huhu), + ("hihi", huhu)]; + +medialist = elementary.List(win); +medialist.size_hint_weight_set(1.0, 1.0) +medialist.size_hint_align_set(-1.0, -1.0) + +box0 = elementary.Box(win); +box0.size_hint_weight_set(1.0, 1.0) +win.resize_object_add(box0); +box0.show(); +box0.pack_end(medialist); +medialist.show(); + +for item in items: + print item[0] + medialist.item_append(item[0], None, None, item[1]); + +medialist.go(); + +win.resize(320,520); +box0.show(); +win.show() +#ecore.main_loop_begin(); +elementary.run(); -- cgit v1.2.3 From 8bf839f8860417df1d14435eeca0774db435caec Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Mon, 28 Dec 2009 03:10:17 +0100 Subject: YalpPGSQLAuth: fix crash in userVerify - fix NullPointer deref - fix Exception Handling Signed-off-by: Manuel Traut --- build.xml | 232 --------------------- src/YalpAuth/YalpPGSqlAuth/PGSqlAuth.java | 10 +- src/YalpAuth/YalpPGSqlAuth/YalpAuthPluginImpl.java | 25 ++- src/YalpClients/SwtClient/Model.java | 4 +- src/YalpServer/AuthPluginHandler.java | 1 + src/yalp.idl | 1 + start-java.sh | 1 + 7 files changed, 31 insertions(+), 243 deletions(-) diff --git a/build.xml b/build.xml index e17faf0..f318f47 100644 --- a/build.xml +++ b/build.xml @@ -229,235 +229,3 @@ -======= - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Doing all - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/YalpAuth/YalpPGSqlAuth/PGSqlAuth.java b/src/YalpAuth/YalpPGSqlAuth/PGSqlAuth.java index ba88ad4..6b6dd56 100644 --- a/src/YalpAuth/YalpPGSqlAuth/PGSqlAuth.java +++ b/src/YalpAuth/YalpPGSqlAuth/PGSqlAuth.java @@ -92,10 +92,16 @@ public class PGSqlAuth { NameComponent path[] = ncRef.to_name(name); ncRef.rebind(path, authPlugin); - PluginInfoHolder tmp = new PluginInfoHolder(pluginInfo); srvCon.ping(err); System.out.println(err.value.descr); - srvCon.registerAuthPlugin(authPlugin, tmp, err ); + + PluginInfoHolder tmp = new PluginInfoHolder(pluginInfo); + MediaType ms[] = new MediaType[1]; + ms[0] = MediaType.OTHER; + AccessInfo ai = new AccessInfo("", "", "", "", AccessType.UNKNOWN_INFO); + tmp.value.supportedTypes = ms; + tmp.value.access = ai; + srvCon.registerAuthPlugin(authPlugin, tmp, err); pluginInfo = tmp.value; if(err.value.code != YalpErrorCode.OK) diff --git a/src/YalpAuth/YalpPGSqlAuth/YalpAuthPluginImpl.java b/src/YalpAuth/YalpPGSqlAuth/YalpAuthPluginImpl.java index d7c7a21..3124845 100644 --- a/src/YalpAuth/YalpPGSqlAuth/YalpAuthPluginImpl.java +++ b/src/YalpAuth/YalpPGSqlAuth/YalpAuthPluginImpl.java @@ -93,31 +93,40 @@ public class YalpAuthPluginImpl extends AuthPluginInterfacePOA{ YalpError error = new YalpError ("auth ok", YalpErrorCode.OK, YalpErrorLevel.ERROR_LEVEL_INFO, "authentication module working"); - try{ - ResultSet result=stat.executeQuery("select * from \"user\" where \"username\" = '"+username+"' and \"passwd\" = '"+passwd+"';"); + try { + String query = "select * from \"Users\" where \"name\" = '"+username+"' and \"passwd\" = '"+passwd+"';"; + + ResultSet result = stat.executeQuery(query); if (result.next()){ - if (result.getBoolean(5)==true) + if (result.getInt(1)>1) { - user.value.level = AccessRights.ADMIN; + user.value = new YalpUser + (666, username, "real name", AccessRights.ADMIN); err.value = error; return; } else { - user.value.level = AccessRights.USER; + user.value = new YalpUser + (666, username, "real name", AccessRights.USER); err.value = error; return; } } else { - user.value.level = AccessRights.DENY; + user.value = new YalpUser + (666, username, "real name", AccessRights.DENY); err.value = error; return; } - }catch (SQLException e){ - user.value.level = AccessRights.DENY; + + } catch (SQLException e){ + System.out.println("SQL ExceptioN!\n"); + e.printStackTrace(); + user.value = new YalpUser + (666, username, "real name", AccessRights.DENY); error.code = YalpErrorCode.ERROR_SQL; error.msg = "failed to send auth request to pgsql db"; error.level = YalpErrorLevel.ERROR_LEVEL_ERROR; diff --git a/src/YalpClients/SwtClient/Model.java b/src/YalpClients/SwtClient/Model.java index 0ebc09c..ce25f54 100755 --- a/src/YalpClients/SwtClient/Model.java +++ b/src/YalpClients/SwtClient/Model.java @@ -197,7 +197,9 @@ public class Model { SessionHolder sess = new SessionHolder(); try{ // log on server - this.srvCon.clientLogon(this.userName,passwd,this.clientIP,sess,err); + this.srvCon.clientLogon(username, passwd, + this.clientIP, sess, err); + this.session = sess.value; this.userGroup = sess.value.me.level; /* diff --git a/src/YalpServer/AuthPluginHandler.java b/src/YalpServer/AuthPluginHandler.java index 1011b69..585e0f9 100644 --- a/src/YalpServer/AuthPluginHandler.java +++ b/src/YalpServer/AuthPluginHandler.java @@ -42,6 +42,7 @@ public class AuthPluginHandler { for (AuthPlugin plugin : plugins) { + System.out.println("LOGON: "+userName); plugin.itf.userVerify(userName, password, err, user); if (err.value.code == YalpErrorCode.OK) { diff --git a/src/yalp.idl b/src/yalp.idl index 4c56fbb..63fd10b 100644 --- a/src/yalp.idl +++ b/src/yalp.idl @@ -103,6 +103,7 @@ enum Action { typedef sequence Actions; enum AccessType { + UNKNOWN_INFO, FILE, FILES, STREAM diff --git a/start-java.sh b/start-java.sh index 9652578..27a5be5 100755 --- a/start-java.sh +++ b/start-java.sh @@ -1,4 +1,5 @@ java \ +-Dswt.library.path=/usr/lib/jni \ -Djava.net.preferIPv4Stack=true \ -Dorg.omg.CORBA.ORBInitialHost=127.0.0.1 \ -Djava.library.path=./lib \ -- cgit v1.2.3 From 2c697bc6618b6b3d02aaf3f6ed70b3489ddc5231 Mon Sep 17 00:00:00 2001 From: Manuel Traut Date: Mon, 28 Dec 2009 11:44:19 +0100 Subject: auth-plugin: add log4j config file Signed-off-by: Manuel Traut --- log4j_auth_plugin.conf | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 log4j_auth_plugin.conf diff --git a/log4j_auth_plugin.conf b/log4j_auth_plugin.conf new file mode 100644 index 0000000..79c355b --- /dev/null +++ b/log4j_auth_plugin.conf @@ -0,0 +1,8 @@ +log4j.rootLogger=debug, stdout + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# Pattern to output the caller's file name and line number. +log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n + -- cgit v1.2.3