Re: Question and project



hello Guillaume! it looks quite nice!

Is it possible to add multi group support to gdm? my
idea is to asign a group of users to a different
/etc/X11/gdm/Sessions directory.

This will allow a single server to give different
Session options to different employees depending on
their job in a company off a different gdm group of
sessions to the teachers from the students at a
school.

What do you think about it? does it have a future?
comments?

btw, I am sure you will like a few gdm themes from
this site 8)


http://www.themedepot.org/showarea.php4?area=11

thanks!

--- Guillaume Proux <gproux acesoliton com> wrote:
> George wrote:
> > I think that you didn't setup pam correctly.  I
> would take a look at the
> 
> Actually, I did not even compile it in ;)
> But now I understood the mistake, it is just that I
> did not have the 
> development package for pam... Now things just
> rocks!
> 
> > Nothing being done in this domain, although plugin
> modules can kind of open
> > up a can of worms in terms of security, so be
> careful if you decide to work
> > on this.  Feel free to send patches :)
> 
> yes, I understand very well. Up to now, the changes
> I have made simply 
> consists of running very specific programs called
> from a path given
> directly in the configuration xml file. Can it be a
> security issue?
> 
> The patches attached do the following things:
> - various cleanups on xmlFreeDoc() (which did not
> seem to be called 
> anywhere (or did I misunderstand xml library
> api?...)
> - adding a new item type (module) that has 2
> parameters
> exetype
> exe
> 
> right now the only valid value for exetype is
> "script" but I thought of 
> extending later with "real" modules (libraries that
> will be smarter than
> just static xml data).
> 
> the exe property must contain the path to the script
> (or compiled code).
> Example:
> <item type="module" exetype="script" 
> exe="/usr/share/gdm/scripts/weather-tokyo.pl"/>
> 
> The module item is handled by patches in
> greeter_parser.c to simply open 
> a pipe to the script, read the full content of the
> pipe as an XML 
> document and feed that output to the parser "as if"
> the text was 
> contained in the original XML file.
> 
> It enables to make very funky personalised login
> screen:
> - display of the weather
> - number of emails waiting in the mailbox
> - Change the background/tint of the theme according
> to the time of the 
> day (night theme, midday theme, evening theme)
> - Display birthday dates or appointment from
> Evolutions
> - display some todos (with support from a third
> party program, you could
> setup the todos content from X)
> - show the TV programs of the day
> - etc.
> The only problem is that it is still static. But I
> don't really see that
> as an enormous problem. The rest will come when it
> is due ! :-)
> 
> As a final note:
> in the attachements you will be able to find:
> - popinfo.pl  a simple perl program to act as a
> module to get info about 
> a POP3 account
> - the diff for greeter_parser.c and greeter_item.h
> from 2.4.1.2
> - circles.xml modified to use my module changes and
> popinfo.pl
> - mail.png and nomail.png added (they come from the
> stockicons in my 
> Mandrake, I am not the author...)
> 
> I use that as my login screen since one week (for
> testing) and I have 
> experienced no problem at all.
> 
> What would you like to appear dynamically on the
> login screen menu?
> What kind of "module" would people want?
> 
> Of course mandatory screenshot of the feature (yes,
> it is japanese
> on that screen ;)):
> 
> # mail waiting in the box
> http://www.acesoliton.com/~gproux/Screenshot.png
> # no mail
> http://www.acesoliton.com/~gproux/Screenshot-1.png
> 
> 
> cheers,
> 
> Guillaume
> > #!/usr/bin/perl
> 
> use Net::POP3;
> 
> my $mail_server = 'xxx';
> my $username = 'xxx';
> my $password = 'xxx';
> 
> my $pop = Net::POP3->new($mail_server,Timeout =>
> 10);
> if (!$pop)
>   {
>   $text="<i>No connection to server</i>";
>   exit 0;
>   }
> $pop->login($username, $password)
>     or exit 2;
> my $messages = $pop->list
>     or exit 3;
> 
> my $count=scalar(keys %$messages);
> if ($count)
> 	{
> 	my $totalbytes=0;
> 		foreach (keys %$messages)
> 		{
> 		$totalbytes += $$messages{$_};
> 		}
> 	my $kb=int($totalbytes/1024);
> 	my $message = "message";
> 	$message.="s" if ($count>1);
> 	$text = "$count $message ($kb kbytes) for gproux";
> 	$mailicon="mail.png";
> 	}
> else
> 	{
> 	$text = "No message for gproux";
> 	$mailicon="nomail.png";
> 	}
> 
> print<<EOF;
> <pluginresult>
> <item type="rect" id="mailinfo">
>   <normal color="#FFFFFF" alpha="0.5"/>
>     <pos anchor="ne" x="-20" y="20" width="box"
> height="box"/>
>     <box orientation="horizontal" min-width="200"
> xpadding="10" ypadding="5" spacing="0">
> <item type="pixmap">
>  <normal file="$mailicon"/>
>  <pos y="50%" anchor="w"/>
> </item>
> <item type="label">
> 	    <normal color="#000000" font="Sans 12"/>
> 	    <pos anchor="c" x="50%" y="50%"/>
> 	    <text>$text</text>
>     </item>
>   </box>
> </item>
> </pluginresult>
> EOF
> exit 0;
> > ---
../../../gdm-2.4.1.2/gui/greeter/greeter_item.h
> 2002-06-02 09:11:58.000000000 +0900
> +++ greeter_item.h	2003-01-29 00:21:22.000000000
> +0900
> @@ -23,6 +23,7 @@
>    GREETER_ITEM_TYPE_PIXMAP,
>    GREETER_ITEM_TYPE_LABEL,
>    GREETER_ITEM_TYPE_ENTRY,
> +  GREETER_ITEM_TYPE_MODULE
>  };
>  
>  enum _GreeterItemSizeType {
> > ---
> ../../../gdm-2.4.1.2/gui/greeter/greeter_parser.c
> 2003-01-03 03:06:50.000000000 +0900
> +++ greeter_parser.c	2003-02-01 00:23:43.000000000
> +0900
> @@ -987,6 +987,8 @@
>      }
>  }
>  
> +
> +
>  static gboolean
>  parse_label (xmlNodePtr        node,
>  	     GreeterItemInfo  *info,
> @@ -1120,20 +1122,134 @@
>    return TRUE;
>  }
>  
> +/* forward declaration for recursively calling
> methods */
> +static gboolean parse_items_in_order
> (xmlNodePtr,GList**,GreeterItemInfo*,GError**);
> +
> +
> +static gboolean 
> +parse_module (xmlNodePtr       node,
> +	      GList          **items,
> +	      GreeterItemInfo *parent,
> +	      GError         **error)
> +{ 
> +  xmlChar *prop;
> +  prop = xmlGetProp (node, "exetype");
> +
> +  if (prop && (strcmp(prop,"script") == 0))
> +    {
> +      xmlFree(prop);
> +      
> +      gchar *text;
> +      const guint textbuffersize = 1024;
> +      guint textsize=0;
> +      guint buffersize = textbuffersize;
> +     
> +      if (! (text = g_malloc(buffersize)))
> +	{
> +	return FALSE;
> +	}
> +      prop = xmlGetProp (node,"exe");
> +      FILE *script;
> +      script=popen(prop, "r");
> +      xmlFree(prop);
> +      
> +      if (!script)
> +	{
> +	g_set_error (error,
> +		     GREETER_PARSER_ERROR,
> +		     GREETER_PARSER_ERROR_BAD_SPEC,
> +		     "Could not open script in module");
> +	  g_free(text);
> +	  return FALSE;
> +	}
> +      else
> +	{
> +	  while (1)
> +	    {
> +	      gint read;
> +	      gchar *ptext = &text[textsize];
> +	      guint leftinbuffer=buffersize-textsize;
> +	      
> +	      read =
> fread(ptext,sizeof(gchar),leftinbuffer-1,script);
> +	      textsize+=read;
> +	      gboolean scripteof = feof(script);
> +	      if ((read == (leftinbuffer-1)) &&
> !scripteof)
> +	        {
> +		  /* we might need more space -- reallocate text
> */
> +		  buffersize *= 2;
> +		  text = g_realloc(text,buffersize);
> +		  if (!text)
> +		    {
> +		      pclose(script);
> +		      return FALSE;
> +		    }
> +		      
> +		}
> +	      if (scripteof)
> +		{
> +		break;
> +		}
> +	    }
> +	  
> +	  text[textsize]='\0';
> + 	  pclose(script);
> +	  /* at that point I can call the xmlParse */
> +	  xmlDoc *doc;
> +	  gboolean res=TRUE;
> +	  doc = xmlParseMemory(text,textsize);
> +	  xmlNodePtr pipe_node;
> +	  if (doc)
> +	    {
> +  	      pipe_node = xmlDocGetRootElement(doc);
> +	      if (pipe_node)
> +	          res =
> parse_items_in_order(pipe_node,items,parent,error); 
> 
> +	      else	        
> +		  res=FALSE;
> +	    }
> +	  else
> +	      res=FALSE;
> +	 
> +	  if (res == FALSE)
> +		  {
> +		    g_free(text);
> +		    g_set_error (error,
> +		                 GREETER_PARSER_ERROR,
> +		                 GREETER_PARSER_ERROR_BAD_SPEC,
> +		                 "Problem parsing plug-ins XML");
> +		  }
> +          if (doc)
> +	      xmlFreeDoc(doc);
> +
> +	  return res;	  
> +	}
> +    }
> +  else if (strcmp (prop,"plug-in") == 0)
> +    {
> +      /* not yet supported sorry */
> +      xmlFree(prop);
> +	g_set_error (error,
> +		     GREETER_PARSER_ERROR,
> +		      GREETER_PARSER_ERROR_BAD_SPEC,
> +		     "Plug-ins not yet supported");
> +
> +      return FALSE;
> +    }
> +  return FALSE;
> +}
> +
> +
>  static gboolean
> -parse_items (xmlNodePtr  node,
> +parse_items_in_order (xmlNodePtr  node,
>  	     GList     **items_out,
>  	     GreeterItemInfo *parent,
>  	     GError    **error)
>  {
>      xmlNodePtr child;
> -    GList *items;
>      gboolean res;
>      xmlChar *type;
>      GreeterItemInfo *info;
>      GreeterItemType item_type;
> -    
> -    items = NULL;
> +    GList *items=*items_out;
>      
>      child = node->children;
>      while (child)
> @@ -1147,14 +1263,14 @@
>  			     GREETER_PARSER_ERROR_BAD_SPEC,
>  			     "Found tag %s when looking for item",
> child->name);
>  		return FALSE;
> -	      }
> -	    
> +	      }      
> +	      
>  	    type = xmlGetProp (child, "type");
>  	    if (!type)
>  	      {
>  		g_set_error (error,
>  			     GREETER_PARSER_ERROR,
> -			     GREETER_PARSER_ERROR_BAD_SPEC,
> +	   		     GREETER_PARSER_ERROR_BAD_SPEC,
>  			     "Items must specify their type");
>  		return FALSE;
>  	      }
> @@ -1169,6 +1285,8 @@
>  	      item_type = GREETER_ITEM_TYPE_LABEL;
>  	    else if (strcmp (type, "entry") == 0)
>  	      item_type = GREETER_ITEM_TYPE_ENTRY;
> +	    else if (strcmp (type, "module") == 0)
> +	      item_type = GREETER_ITEM_TYPE_MODULE;
>  	    else
>  	      {
>  		g_set_error (error,
> @@ -1178,51 +1296,81 @@
>  		xmlFree (type);
>  		return FALSE;
>  	      }
> -	    
> -	    info = greeter_item_info_new (parent,
> item_type);
> -	    
> -	    parse_id (child, info);
> -	    if ( ! parse_button (child, info, error))
> -	      return FALSE;
> -
> -	    switch (item_type)
> 
=== message truncated ===> <?xml version="1.0"?>
> <!DOCTYPE greeter SYSTEM "greeter.dtd">
> <greeter>
>   <item type="svg">
>     <normal file="background.svg"/>
>     <pos x="0" y="0" width="100%" height="-75"/>
>   </item>
>   <item type="rect">
>     <normal color="#000000"/>
>     <pos x="0" y="-75" width="100%" height="75"/>
>     <fixed>
>       <item type="rect">
>         <normal color="#ffffff"/>
>         <pos x="0" y="4" width="100%"
> height="100%"/>
>         <box orientation="horizontal" spacing="10"
> xpadding="10">
>           <item type="rect" id="language_button"
> button="true">
>             <normal color="#ffffff"/>
> 	    <pos y="50%" anchor="w" width="box"
> height="box"/>
>             <box orientation="horizontal"
> spacing="10" xpadding="10">
> 	      <item type="pixmap">
> 	        <normal file="options.png" tint="#dddddd"/>
> 	        <prelight file="options.png"/>
> 	        <active file="options.png" tint="#ff0000"/>
> 	        <pos y="50%" anchor="w"/>
> 	      </item>
> 	      <item type="label">
> 	        <normal color="#000000" font="Sans 14"/>
> 		<prelight color="#666666" font="Sans 14"/>
> 		<active color="#ff0000" font="Sans 14"/>
> 	        <pos y="50%" anchor="w"/>
> 		<!-- Stock label for: _Language -->
> 		<stock type="language"/>
> 		<!-- Kept for compatibility with older gdm
> versions -->
> 		<text>_Language</text>
> 		<text xml:lang="am">á??á??á?? (_L)</text>
> 		<text xml:lang="be">_Ð?ова</text>
> 		<text xml:lang="bg">_Ð?зик</text>
> 		<text xml:lang="ca">_Llengua</text>
> 		<text xml:lang="cs">_Jazyk</text>
> 		<text xml:lang="da">S_prog</text>
> 		<text xml:lang="de">S_prache</text>
> 		<text xml:lang="el">Î?_λÏ?Ï?Ï?α</text>
> 		<text xml:lang="es">_Idioma</text>
> 		<text xml:lang="et">_Keel</text>
> 		<text xml:lang="fi">_Kieli</text>
> 		<text xml:lang="fr">_Langue</text>
> 		<text xml:lang="gl">_Lingua</text>
> 		<text xml:lang="he">_שפ×?</text>
> 		<text xml:lang="hu">_Nyelv</text>
> 		<text xml:lang="ja">��(_L)</text>
> 		<text xml:lang="ko">��(_L)</text>
> 		<text xml:lang="lt">_Kalba</text>
> 		<text xml:lang="lv">_Valoda</text>
> 		<text xml:lang="ms">_Bahasa</text>
> 		<text xml:lang="nl">_Taal</text>
> 		<text xml:lang="no">S_pråk</text>
> 		<text xml:lang="pl">_JÄ?zyk</text>
> 		<text xml:lang="pt">_Idioma</text>
> 		<text xml:lang="pt_BR">_Idioma</text>
> 		<text xml:lang="ro">_Limbã</text>
> 		<text xml:lang="ru">_ЯзÑ?к</text>
> 		<text xml:lang="sk">_Jazyk</text>
> 		<text xml:lang="sl">_Jezik</text>
> 		<text xml:lang="sv">S_pråk</text>
> 		<text xml:lang="vi">N_gôn ngữ</text>
> 		<text xml:lang="zh_CN">语�(_L)</text>
> 		<text xml:lang="zh_TW">��(_L)</text>
> 	      </item>
>             </box>
>           </item>
>           <item type="rect" id="session_button"
> button="true">
>             <normal color="#ffffff"/>
> 	    <pos y="50%" anchor="w" width="box"
> height="box"/>
>             <box orientation="horizontal"
> spacing="10" xpadding="10">
> 	      <item type="pixmap">
> 	        <normal file="help.png" tint="#dddddd"/>
> 	        <prelight file="help.png"/>
> 	        <active file="help.png" tint="#ff0000"/>
> 	        <pos y="50%" anchor="w"/>
> 	      </item>
> 	      <item type="label">
> 	        <normal color="#000000" font="Sans 14"/>
> 		<prelight color="#666666" font="Sans 14"/>
> 		<active color="#ff0000" font="Sans 14"/>
> 	        <pos y="50%" anchor="w"/>
> 		<!-- Stock label for: _Session -->
> 		<stock type="session"/>
> 		<!-- Kept for compatibility with older gdm
> versions -->
> 		<text>_Session</text>
> 		<text xml:lang="am">á?­á??á?? á??á?? (_S)</text>
> 		<text xml:lang="be">_СÑ?анÑ?</text>
> 		<text xml:lang="bg">_СеÑ?иÑ?</text>
> 		<text xml:lang="ca">_Sessió</text>
> 		<text xml:lang="cs">_Sezení</text>
> 		<text xml:lang="da">_Session</text>
> 		<text xml:lang="de">_Sitzung</text>
> 		<text xml:lang="el">ΣÏ?νε_δÏ?ία</text>
> 		<text xml:lang="es">_Sesión</text>
> 		<text xml:lang="et">_Sessioon</text>
> 		<text xml:lang="fi">_Istunto</text>
> 		<text xml:lang="fr">_Session</text>
> 		<text xml:lang="gl">_Sesión</text>
> 		<text xml:lang="he">_תצ×?רת ×?פע×?×?</text>
> 		<text xml:lang="hu">_Munkamenet</text>
> 		<text xml:lang="ja">ã?»ã??ã?·ã?§ã?³(_S)</text>
> 		<text xml:lang="ko">ì?¸ì??(_S)</text>
> 		<text xml:lang="lt">_Sesija</text>
> 		<text xml:lang="lv">_Sesija</text>
> 		<text xml:lang="ms">_Sesi</text>
> 		<text xml:lang="nl">_Sessie</text>
> 		<text xml:lang="no">_Sesjon</text>
> 		<text xml:lang="pl">_Sesja</text>
> 		<text xml:lang="pt">_Sessão</text>
> 		<text xml:lang="pt_BR">_Sessão</text>
> 		<text xml:lang="ro">S_esiune</text>
> 		<text xml:lang="ru">_СеанÑ?</text>
> 		<text xml:lang="sk">_Sedenie</text>
> 		<text xml:lang="sl">_Seja</text>
> 		<text xml:lang="sv">_Session</text>
> 		<text xml:lang="vi">_Session</text>
> 		<text xml:lang="zh_CN">��(_S)</text>
> 		<text xml:lang="zh_TW">ä½?業é??段(_S)</text>
> 	      </item>
>             </box>
>           </item>
>           <item type="rect" id="system_button"
> button="true">
>             <normal color="#ffffff"/>
> 	    <show modes="console" type="system"/>
> 	    <pos y="50%" anchor="w" width="box"
> height="box"/>
>             <box orientation="horizontal"
> spacing="10" xpadding="10">
> 	      <item type="pixmap">
> 	        <normal file="options.png" tint="#dddddd"/>
> 	        <prelight file="options.png"/>
> 	        <active file="options.png" tint="#ff0000"/>
> 	        <pos y="50%" anchor="w"/>
> 	      </item>
> 	      <item type="label">
> 	        <normal color="#000000" font="Sans 14"/>
> 		<prelight color="#666666" font="Sans 14"/>
> 		<active color="#ff0000" font="Sans 14"/>
> 	        <pos y="50%" anchor="w"/>
> 		<!-- Stock label for: S_ystem -->
> 		<stock type="system"/>
> 		<!-- Kept for compatibility with older gdm
> versions -->
> 		<text>S_ystem</text>
> 		<text xml:lang="am">á?²á?µá?°á?? (_Y)</text>
> 		<text xml:lang="be">_СÑ?Ñ?Ñ?Ñ?ма</text>
> 		<text xml:lang="bg">_СÑ?Ñ?Ñ?ема</text>
> 		<text xml:lang="ca">S_istema</text>
> 		<text xml:lang="cs">S_ystém</text>
> 		<text xml:lang="da">S_ystem</text>
> 		<text xml:lang="de">S_ystem</text>
> 		<text xml:lang="el">_ΣÏ?Ï?Ï?ημα</text>
> 		<text xml:lang="es">S_istema</text>
> 		<text xml:lang="et">S_üsteem</text>
> 		<text xml:lang="fi">_Järjestelmä</text>
> 		<text xml:lang="fr">S_ystème</text>
> 		<text xml:lang="gl">S_istema</text>
> 		<text xml:lang="he">_×?ער×?ת</text>
> 		<text xml:lang="hu">_Rendszer</text>
> 		<text xml:lang="ja">ã?·ã?¹ã??ã? (_y)</text>
> 		<text xml:lang="ko">ì??ì?¤í??(_Y)</text>
> 		<text xml:lang="lt">S_istema</text>
> 		<text xml:lang="lv">S_istÄ?ma</text>
> 		<text xml:lang="ms">S_istem</text>
> 		<text xml:lang="nl">S_ysteem</text>
> 		<text xml:lang="no">S_ystem</text>
> 		<text xml:lang="pl">_Systemowe</text>
> 		<text xml:lang="pt">S_istema</text>
> 		<text xml:lang="pt_BR">Sis_tema</text>
> 		<text xml:lang="ro">_Sistem</text>
> 		<text xml:lang="ru">_СиÑ?Ñ?ема</text>
> 		<text xml:lang="sk">S_ystém</text>
> 		<text xml:lang="sl">_Sistem</text>
> 		<text xml:lang="sv">S_ystem</text>
> 		<text xml:lang="vi">_Há»? thá»?ng</text>
> 		<text xml:lang="zh_CN">系�(_Y)</text>
> 		<text xml:lang="zh_TW">系統(_Y)</text>
> 	      </item>
>             </box>
>           </item>
>           <item type="rect" id="disconnect_button"
> button="true">
>             <normal color="#ffffff"/>
> 	    <show modes="flexi,remote"/>
> 	    <pos y="50%" anchor="w" width="box"
> height="box"/>
> 
=== message truncated ===

> ATTACHMENT part 6 image/png name=mail.png


> ATTACHMENT part 7 image/png name=nomail.png
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: gdm-unsubscribe sunsite dk
> For additional commands, e-mail: gdm-help sunsite dk


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]