<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi too,<br>
<br>
Well logging into the QGIS-project should really be a big deal right
? - You only have to log in once no matter how many layers are
loaded from the database. I have a table inside my QGIS project
where I can create new users inside the database and administer
reading/writing/admin-privileges.<br>
<div class="moz-signature"><font face="Tahoma"> <br>
Mvh. / Best regards</font><br>
<div class="moz-signature"><font face="Tahoma"> </font><font
face="Tahoma">Casper Bertelsen</font><font face="Tahoma"></font><br>
<div class="moz-signature"><font face="Tahoma"> <br>
</font></div>
</div>
</div>
<div class="moz-cite-prefix">On 22/08/2017 13:34, Karl Magnus
Jönsson wrote:<br>
</div>
<blockquote type="cite"
cite="mid:38a24907e57343a4adccbf79c4b31410@kristianstad.se">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Franklin Gothic Book";
panose-1:2 11 5 3 2 1 2 2 2 4;}
@font-face
{font-family:"Century Gothic";
panose-1:2 11 5 2 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-postmall17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.E-postmall18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><a name="T_Default_Reply"
moz-do-not-send="true"><span style="color:#1F497D">Hi!<o:p></o:p></span></a></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">I’ve
made the same things with triggers in the database. To avoid
getting same username I’ve chosen not to save the username
and password in the project. But then the user have to enter
it every time the projects opens. If you can find a solution
to your suggested approach it would be nice.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Franklin
Gothic
Book","sans-serif";color:black;mso-fareast-language:SV">Karl-Magnus
</span></b><span
style="font-size:10.0pt;font-family:"Franklin Gothic
Book","sans-serif";color:black;mso-fareast-language:SV"><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:SV">Från:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";mso-fareast-language:SV">
Qgis-user [<a class="moz-txt-link-freetext" href="mailto:qgis-user-bounces@lists.osgeo.org">mailto:qgis-user-bounces@lists.osgeo.org</a>]
<b>För </b>McDonaldR<br>
<b>Skickat:</b> den 22 augusti 2017 13:12<br>
<b>Till:</b> <a class="moz-txt-link-abbreviated" href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a><br>
<b>Ämne:</b> [Qgis-user] Updating a field set with
default global variable on edit<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Hi List,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="background:white" lang="EN-GB">Anyone
know how to update a field that has a global variable set as
the default value when records are edited (geometry and/or
attributes)?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><br>
<span style="background:white">We have a QGIS project with a
PostGIS layer loaded and configured with look-ups and
relations so the users can update all the relevant fields.
There are also "<b>created_by</b>" and "<b>updated_by</b>"
fields. These are updated by a trigger in the database
with the "<b>current_user</b>" database variable. This
works fine if you are the current user that added the
layer to the project - the trigger works perfectly.
</span><br>
<br>
<span style="background:white">If you give the project to
someone else and they create and edit features in the
layer the fields are still updated with your name as you
are the person who added the layer to the project. Not
what we want.</span><br>
<br>
<span style="background:white">QGIS has global variables and
there are some new ones -
<b>user_account_name</b> and <b>user_full_name</b> that
can be set as default values for the fields. When a new
feature is created the field is populated with the correct
name. Which is what we want.</span><br>
<br>
<span style="background:white">However, when we update an
existing record we'd like the "<b>updated_by</b>" field to
be updated with the current "<b>user_account_name</b>".
Like a trigger in the database would do on update. Then we
would have a better idea of the history of the feature.<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="background:white" lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="background:white" lang="EN-GB">Ross</span><span
lang="EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Century
Gothic","sans-serif";color:#4F6228;mso-fareast-language:EN-GB"
lang="EN-GB">Ross McDonald |
</span></b><span
style="font-size:10.0pt;font-family:"Century
Gothic","sans-serif";color:#4F6228;mso-fareast-language:EN-GB"
lang="EN-GB">GIS Data Coordinator | Angus Council, People,
IT | Angus House, Orchardbank Business Park, Sylvie Way,
Forfar DD8 1AT<b> | t: 01307 476419<o:p></o:p></b></span></p>
<p class="MsoNormal"><span lang="EN-GB"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span
style="font-size:12.0pt;font-family:"Times New
Roman","serif";mso-fareast-language:SV"
lang="EN-GB"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""
lang="EN-GB">This message is strictly confidential. If you
have received this in error, please inform the sender and
remove it from your system. If received in error you may
not copy, print, forward or use it or any attachment in
any way. This message is not capable of creating a legal
contract or a binding representation and does not
represent the views of Angus Council. Emails may be
monitored for security and network management reasons.
Messages containing inappropriate content may be
intercepted. Angus Council does not accept any liability
for any harm that may be caused to the recipient system or
data on it by this message or any attachment.
</span><span lang="EN-GB"><o:p></o:p></span></p>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
</body>
</html>