<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Oh, sorry, wrong link.<br>
    To set entries by digitizing a link like <br>
    <br>
<a class="moz-txt-link-freetext" href="http://www.blumige-landschaft.de/mapbender3/application/Blumige-Landschaften?anwender=blablablabla@">http://www.blumige-landschaft.de/mapbender3/application/Blumige-Landschaften?anwender=blablablabla@</a><br>
    <br>
    is used.<br>
    <br>
    Best regards, Kai<br>
    <br>
    <div class="moz-cite-prefix">Am 12.04.2016 um 05:55 schrieb Dr. Kai
      Behncke:<br>
    </div>
    <blockquote class=" cite"
      id="mid_570C71A6_7000604_blumige_landschaften_de"
      cite="mid:570C71A6.7000604@blumige-landschaften.de" type="cite">
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      Hi you all,<br>
      <br>
      <br>
      we found a solution for that, well not a very nice one, because of
      no knowledge of symfony, the code is "hot-chaos", but it works:<br>
      <br>
      <br>
      In: <br>
      mapbender3/vendor/mapbender/digitizer/Mapbender/DigitizerBundle/Element/Digitizer.php  


      <br>
      <br>
      From line 169: <br>
                    <br>
      <br>
      169     public function httpAction($action)<br>
      170     {<br>
      171         /**<br>
      172          * @var $requestService Request<br>
      173          */<br>
      174        
      $der_nutzername=$this->container->get('request');<br>
      175<br>
      176<br>
      177 if ((substr_count($der_nutzername,'anwender=')==1) AND
      (substr_count($der_nu    tzername,'@')==1)) {<br>
      178<br>
      179<br>
      180    $der_nutzername_array = explode ('anwender=',
      $der_nutzername );<br>
      181         $der_nutzername=$der_nutzername_array[1];<br>
      182 <br>
      183   $der_nutzername=trim($der_nutzername);<br>
      184 $der_nutzername_array2=explode ('@',$der_nutzername);<br>
      185         $der_nutzername=$der_nutzername_array2[0];<br>
      186         $der_nutzername=str_replace(" ","",$der_nutzername);<br>
      187         $der_nutzername="digiowner='".$der_nutzername."'";<br>
      188         $der_nutzername=trim($der_nutzername);<br>
      189    $der_nutzername=str_replace(" ","",$der_nutzername);<br>
      190   // $der_nutzername="nnn".$der_nutzername->get('Referer');<br>
      191 }<br>
      192 else {<br>
      193 <br>
      194 $der_nutzername="digiowner='xxxxx'";<br>
      195 }<br>
      <br>
      ....<br>
      ......<br>
      (This is to get the user of a request; for that, in the
      digitite-table (e.g. "poi" a column "digiowner" is important)<br>
      <br>
      In <br>
mapbender3/vendor/mapbender/digitizer/Mapbender/DigitizerBundle/Entity/FeatureType.php<br>
      <br>
      In line 396:<br>
      <br>
       public function search(array $criteria = array(),$neue_variable)<br>
           {<br>
      <br>
      // In $neue_variable a username is transported<br>
      <br>
      422: $where=$neue_variable;<br>
      423     if($where){<br>
      424             $queryBuilder->andWhere($where);<br>
      425         }<br>
      <br>
      And:  in 
mapbender/digitizer/Mapbender/DigitizerBundle/Resources/public/mapbender.element.digitizer.js<br>
      <br>
      Line 1305: var the_request=JSON.stringify(request);<br>
      1306 the_request+=""<br>
      <br>
      ...<br>
      <br>
      .....<br>
      1315 if (uri=="save"){<br>
      1316<br>
      1317
the_request=the_request.replace('}',',"digiowner":"'+der_nutzername+'"}');<br>
      ....<br>
      ........<br>
      <br>
      A changed request is build so a geometry belongs to a specific
      user...<br>
      <br>
      <br>
      So if someone calls:<br>
      <br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.blumige-landschaft.de/mapbender3/application/Blumige-Landschaften">http://www.blumige-landschaft.de/mapbender3/application/Blumige-Landschaften</a><br>
      <br>
      he can`t insert  entries.<br>
      If one calls: <br>
      <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.blumige-landschaft.de/mapbender3/application/Blumige-Landschaften?anwender=blablablabla">http://www.blumige-landschaft.de/mapbender3/application/Blumige-Landschaften?anwender=blablablabla</a><br>
      <br>
      he can.<br>
      <br>
      <br>
      I know, it`s not a "save"-procedure at all, but enough for the
      purposes of that project :-)<br>
      <br>
      the project is: <a moz-do-not-send="true"
        class="moz-txt-link-freetext"
        href="http://blumige-landschaften.de">http://blumige-landschaften.de</a><br>
      <br>
      A databse-trigger sets area and time of an entry<br>
      <br>
      <br>
      CREATE OR REPLACE FUNCTION datum_einspielen()<br>
        RETURNS trigger AS<br>
      $BODY$<br>
      DECLARE<br>
      <br>
      the_id  integer;<br>
      abfrage1 text;<br>
      <br>
      BEGIN<br>
      the_id:=max(gid) as gid from poi;<br>
      <br>
      abfrage1:='UPDATE poi SET date_favorite=TO_CHAR(CURRENT_DATE,
      ''DD.MM.YYYY'') WHERE gid='||the_id;<br>
      EXECUTE abfrage1;<br>
      RAISE NOTICE 'Here we go........%',the_id;<br>
      RETURN NULL;<br>
      END;<br>
      $BODY$<br>
        LANGUAGE 'plpgsql' VOLATILE;<br>
      <br>
      <br>
      <br>
      CREATE TRIGGER Trigger_after_poi_entry<br>
      AFTER INSERT on poi<br>
      FOR EACH ROW<br>
      EXECUTE PROCEDURE datum_einspielen();<br>
      <br>
      <br>
      <br>
      CREATE OR REPLACE FUNCTION give_me_area_and_date()<br>
        RETURNS trigger AS<br>
      $BODY$<br>
      DECLARE<br>
      <br>
      the_id  integer;<br>
      the_area numeric;<br>
      abfrage1 text;<br>
      abfrage2 text;<br>
      block text;<br>
      BEGIN<br>
      the_id:=max(gid) as gid from polygons;<br>
      the_area:=round(cast(st_area(st_transform(geom,31467)) as
      numeric),2) from polygons where gid=the_id;<br>
      <br>
      abfrage1:='UPDATE polygons SET date_favorite=TO_CHAR(CURRENT_DATE,
      ''DD.MM.YYYY'') WHERE gid='||the_id;<br>
      EXECUTE abfrage1;<br>
      abfrage2:='UPDATE polygons SET area='''||the_area||''' WHERE
      gid='||the_id;<br>
      EXECUTE abfrage2;<br>
      <br>
      RETURN NULL;<br>
      END;<br>
      $BODY$<br>
        LANGUAGE 'plpgsql' VOLATILE;<br>
      <br>
      <br>
      <br>
      CREATE TRIGGER Trigger_after_polygon_entry<br>
      AFTER INSERT on polygons<br>
      FOR EACH ROW<br>
      EXECUTE PROCEDURE give_me_area_and_date();<br>
      <br>
      Best regards, Kai
      <pre class="moz-signature" cols="72">-- 
---------------------------
Blumige-Landschaften.de
Dr. Kai Behncke
Am Wulberg 15
49324 Melle
Tel.: 0176-84019660 (ab 18.00 Uhr)</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Mapbender_users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mapbender_users@lists.osgeo.org">Mapbender_users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapbender_users">http://lists.osgeo.org/mailman/listinfo/mapbender_users</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
---------------------------
Blumige-Landschaften.de
Dr. Kai Behncke
Am Wulberg 15
49324 Melle
Tel.: 0176-84019660 (ab 18.00 Uhr)</pre>
  </body>
</html>