Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Encryption / decryption


Reply


5 Posts   877 Views

Avatar
borriej

Community Member, 267 Posts

23 February 2012 at 12:12am

Edited: 24/04/2012 11:16pm

Hello,

I'm using a modelAdmin to manage a tabel.

This tabel contains ames/addresses.. these are not encrypted yet.

How do i encrypt them? and how do i decrypt them in a way no one can view them if he/she just visits the database?

I want the user and the admins to be able to view them in their profile and modelAdmin, so they must be decrypted as well.

any idea?

Thanks in advance!

Avatar
borriej

Community Member, 267 Posts

28 February 2012 at 4:13am

up!

Avatar
borriej

Community Member, 267 Posts

17 April 2012 at 7:09am

up!

Avatar
borriej

Community Member, 267 Posts

24 April 2012 at 6:44am

Edited: 24/04/2012 6:45am

i have no template to run functions through, because it's an automatically generated page with the User's profile.

i need a function like

<?php

class MemberExtraStatics extends DataObjectDecorator {

function onLoad() {
/* Run decrypt function */
$this->getBankNumber();
}
}

How do i run a certain function on page load?

Ty!

Avatar
Plato

Community Member, 26 Posts

24 April 2012 at 8:55am

The entire controller gets instantiated on page load. By default, the 'action' run is index(), so you could use this.
Or you could use init() if you want it to run on every load, not just the default (no) action.

Otherwise you can run renderWith to explicitly run a template.