Commits

Anonymous committed 015825e

Version beta12

Changed function delete_private_data() to delete more data, including tables setting and member_image, for better data protection

Bugfix related to linux-sh in shell script lf_export

New fields password_reset_secret and password_reset_secret_expiry in member table

UNIQUE constraint for notify_email_secret and password_reset_secret fields in member table

Database constraint forbids adding yourself as a contact

Comments (0)

Files changed (2)

 BEGIN;
 
 CREATE VIEW "liquid_feedback_version" AS
-  SELECT * FROM (VALUES ('beta11', NULL, NULL, NULL))
+  SELECT * FROM (VALUES ('beta12', NULL, NULL, NULL))
   AS "subquery"("string", "major", "minor", "revision");
 
 
         "active"                BOOLEAN         NOT NULL DEFAULT TRUE,
         "admin"                 BOOLEAN         NOT NULL DEFAULT FALSE,
         "notify_email"          TEXT,
-        "notify_email_unconfirmed"   TEXT,
-        "notify_email_secret"        TEXT,
-        "notify_email_secret_expiry" TIMESTAMPTZ,
+        "notify_email_unconfirmed"     TEXT,
+        "notify_email_secret"          TEXT     UNIQUE,
+        "notify_email_secret_expiry"   TIMESTAMPTZ,
+        "password_reset_secret"        TEXT     UNIQUE,
+        "password_reset_secret_expiry" TIMESTAMPTZ,
         "name"                  TEXT            NOT NULL UNIQUE,
         "identification"        TEXT            UNIQUE,
         "organizational_unit"   TEXT,
         PRIMARY KEY ("member_id", "other_member_id"),
         "member_id"             INT4            REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
         "other_member_id"       INT4            REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
-        "public"                BOOLEAN         NOT NULL DEFAULT FALSE );
+        "public"                BOOLEAN         NOT NULL DEFAULT FALSE,
+        CONSTRAINT "cant_save_yourself_as_contact"
+          CHECK ("member_id" != "other_member_id") );
 
 COMMENT ON TABLE "contact" IS 'Contact lists';
 
           AND "direct_voter"."member_id" ISNULL
           AND "delegating_voter"."member_id" ISNULL
       LOOP
-        INSERT INTO "direct_voter" ("member_id", "issue_id", "autoreject")
-          VALUES ("member_id_v", "issue_id_p", TRUE);
+        INSERT INTO "direct_voter"
+          ("member_id", "issue_id", "weight", "autoreject") VALUES
+          ("member_id_v", "issue_id_p", 1, TRUE);
         INSERT INTO "vote" (
           "member_id",
           "issue_id",
       "issue_id_v" "issue"."id"%TYPE;
     BEGIN
       UPDATE "member" SET
-        "login"                      = 'login' || "id"::text,
-        "password"                   = NULL,
-        "notify_email"               = NULL,
-        "notify_email_unconfirmed"   = NULL,
-        "notify_email_secret"        = NULL,
-        "notify_email_secret_expiry" = NULL;
+        "login"                        = 'login' || "id"::text,
+        "password"                     = NULL,
+        "notify_email"                 = NULL,
+        "notify_email_unconfirmed"     = NULL,
+        "notify_email_secret"          = NULL,
+        "notify_email_secret_expiry"   = NULL,
+        "password_reset_secret"        = NULL,
+        "password_reset_secret_expiry" = NULL,
+        "organizational_unit"          = NULL,
+        "internal_posts"               = NULL,
+        "realname"                     = NULL,
+        "birthday"                     = NULL,
+        "address"                      = NULL,
+        "email"                        = NULL,
+        "xmpp_address"                 = NULL,
+        "website"                      = NULL,
+        "phone"                        = NULL,
+        "mobile_phone"                 = NULL,
+        "profession"                   = NULL,
+        "external_memberships"         = NULL,
+        "external_posts"               = NULL,
+        "statement"                    = NULL;
+      -- "text_search_data" is updated by triggers
       DELETE FROM "session";
       DELETE FROM "invite_code" WHERE "used" ISNULL;
       DELETE FROM "contact" WHERE NOT "public";
+      DELETE FROM "setting";
+      DELETE FROM "member_image";
       DELETE FROM "direct_voter" USING "issue"
         WHERE "direct_voter"."issue_id" = "issue"."id"
         AND "issue"."closed" ISNULL;
     echo "Dumping and compressing copied database to \"$2\"..."
     if pg_dump --no-owner --no-privileges "$EXPORT_DBNAME" | gzip -9 > "$2"
     then
+      true
     else
       retval=4
     fi