18 require_once SQ_CORE_PACKAGE_PATH.
'/users/backend_user/backend_user.inc';
51 $this->_ser_attrs = TRUE;
54 if (!$ipbid || empty($data)) {
58 $ipb_bridge =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($ipbid,
'ipb_bridge');
59 if (is_null($ipb_bridge))
return;
61 $this->_ipbid = $ipbid;
64 $this->
id = $ipb_bridge->id.
':'.$data[
'id'];
65 if (!isset($data[
'name'])) {
66 $this->name = translate(
'ipb_unknown_user');
68 $this->name = $data[
'name'];
71 $this->short_name = $this->name;
72 $this->status = $ipb_bridge->status;
73 $this->version =
'0.1';
74 if (!empty($ipb_bridge->created)) {
75 $this->created = date(
'Y-m-d H:m:i', $ipb_bridge->created);
77 if (!empty($ipb_bridge->updated)) {
78 $this->updated = date(
'Y-m-d H:m:i', $ipb_bridge->updated);
80 if (!empty($ipb_bridge->published)) {
81 $this->published = date(
'Y-m-d H:m:i', $ipb_bridge->published);
83 if (!empty($ipb_bridge->status_changed)) {
84 $this->status_changed = date(
'Y-m-d H:m:i', $ipb_bridge->status_changed);
91 $this->vars[
'mgroup'][
'type'] =
'text';
92 $this->vars[
'mgroup'][
'value'] = (empty($data[
'mgroup'])) ?
'none' : $data[
'mgroup'];
94 $this->vars[
'name'][
'type'] =
'text';
95 $this->vars[
'name'][
'value'] = (empty($data[
'name'])) ?
'none' : $data[
'name'];
97 $this->vars[
'email'][
'type'] =
'email';
98 $this->vars[
'email'][
'value'] = (empty($data[
'email'])) ?
'none' : $data[
'email'];
100 $this->vars[
'title'][
'type'] =
'text';
101 $this->vars[
'title'][
'value'] = (empty($data[
'title'])) ?
'none' : $data[
'title'];
103 $this->vars[
'member_login_key'][
'type'] =
'text';
104 $this->vars[
'member_login_key'][
'value'] = (empty($data[
'member_login_key'])) ?
'none' : $data[
'member_login_key'];
106 $day_empty = empty($data[
'bday_day']);
107 $month_empty = empty($data[
'bday_month']);
108 $year_empty = empty($data[
'bday_year']);
109 $this->vars[
'date_of_birth'][
'type'] =
'text';
110 if ($day_empty || $month_empty || $year_empty) {
111 $this->vars[
'date_of_birth'][
'value'] =
'none';
113 $this->vars[
'date_of_birth'][
'value'] = $data[
'bday_day'].
' / '.$data[
'bday_month'].
' / '.$data[
'bday_year'];
116 if (isset($data[
'photo_type'])) {
117 $this->vars[
'photo_type'][
'value'] = $data[
'photo_type'];
119 $this->vars[
'photo_type'][
'value'] =
'';
121 $this->vars[
'photo_type'][
'type'] =
'text';
123 if (isset($data[
'photo_location'])) {
124 $this->vars[
'photo_location'][
'value'] = $data[
'photo_location'];
126 $this->vars[
'photo_location'][
'value'] =
'';
128 $this->vars[
'photo_location'][
'type'] =
'text';
130 $this->vars[
'aim_name'][
'type'] =
'text';
131 $this->vars[
'aim_name'][
'value'] = (empty($data[
'aim_name'])) ?
'none' : $data[
'aim_name'];
133 $this->vars[
'icq_number'][
'type'] =
'text';
134 $this->vars[
'icq_number'][
'value'] = (empty($data[
'icq_number'])) ?
'none' : $data[
'icq_number'];
136 $this->vars[
'website'][
'type'] =
'text';
137 $this->vars[
'website'][
'value'] = (empty($data[
'website'])) ?
'none' : $data[
'website'];
139 $this->vars[
'yahoo'][
'type'] =
'text';
140 $this->vars[
'yahoo'][
'value'] = (empty($data[
'yahoo'])) ?
'none' : $data[
'yahoo'];
142 $this->vars[
'interests'][
'type'] =
'text';
143 $this->vars[
'interests'][
'value'] = (empty($data[
'interests'])) ?
'none' : html_entity_decode($data[
'interests']);
145 $this->vars[
'msnname'][
'type'] =
'text';
146 $this->vars[
'msnname'][
'value'] = (empty($data[
'msnname'])) ?
'none' : $data[
'msnname'];
148 $this->vars[
'vdirs'][
'type'] =
'text';
149 $this->vars[
'vdirs'][
'value'] = (empty($data[
'vdirs'])) ?
'none' : $data[
'vdirs'];
151 $this->vars[
'location'][
'type'] =
'text';
152 $this->vars[
'location'][
'value'] = (empty($data[
'location'])) ?
'none' : $data[
'location'];
154 $this->vars[
'signature'][
'type'] =
'text';
155 $this->vars[
'signature'][
'value'] = (empty($data[
'signature'])) ?
'none' : $data[
'signature'];
157 $this->vars[
'avatar_location'][
'type'] =
'text';
158 $this->vars[
'avatar_location'][
'value'] = (empty($data[
'avatar_location'])) ?
'none' : $data[
'avatar_location'];
160 $this->vars[
'avatar_size'][
'type'] =
'text';
161 $this->vars[
'avatar_size'][
'value'] = (empty($data[
'avatar_size'])) ?
'none' : $data[
'avatar_size'];
163 $this->vars[
'avatar_type'][
'type'] =
'text';
164 $this->vars[
'avatar_type'][
'value'] = (empty($data[
'avatar_type'])) ?
'none' : $data[
'avatar_type'];
167 $ipb =& $ipb_bridge->getIpbConn();
168 $custom_fields = $ipb->getCustomFields();
169 $user_custom_data = $ipb->getMemberCustomFieldData($this->
id);
170 foreach ($custom_fields as $field) {
171 $field_name = strtolower($field[
'pf_title']);
172 $field_name = str_replace(
' ',
'_', $field_name);
173 $field_value = (isset($user_custom_data[0][
'field_'.$field[
'pf_id']]) ? $user_custom_data[0][
'field_'.$field[
'pf_id']] :
'');
174 $this->vars[$field_name][
'value'] = $field_value;
175 $this->vars[$field_name][
'type'] =
'text';